Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File object file_class and File inconsistent #61

Open
luttje opened this issue Nov 27, 2024 · 0 comments
Open

File object file_class and File inconsistent #61

luttje opened this issue Nov 27, 2024 · 0 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@luttje
Copy link
Owner

luttje commented Nov 27, 2024

According to the wiki file.Open returns a file_class

On the file_class page the type name is specified as File:

<ambig page="file">You might be looking for the "file" Library, which has the same name as this class.</ambig>

<type name="File" category="classfunc" is="class">
	<summary>This is the file object. It used used primarily to read or write binary data from files.  
The default endianness is little-endian. To use big-endian you will need to provide your own functions to read and write shorts and longs.

		The object is returned by <page>file.Open</page>.
	</summary>
</type>

This causes neither type to be correct when using file.Open:

The generated library and class annotations for reference: https://github.com/luttje/glua-api-snippets/blob/lua-language-server-addon/library/file.lua

I guess this is done on the wiki because of case insensitivity, so there can't be File and file page for the class and library respectively.

Possible Solutions

What I can think of right now:

  • Changing the wiki in some way (seems cumbersome)
  • Adding a way to transform scraped data according to a list of exceptions/rules, in this case: replacing file_class with File
  • Using the name attribute instead of the type attribute from the file.Open function wiki (not sure if that would be correct everywhere):
    <ret name="File" type="file_class">The opened file object, or `nil` if it failed to open due to it not existing or being used by another process.</ret>
@luttje luttje added bug Something isn't working help wanted Extra attention is needed labels Nov 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant