Skip to content

project.getGmlFile() should take a String OR a Pathy instance, instead of just a Pathy instance. #292

Description

@nutt-y

Hello!
I have been trying to use the @bscotch/gml-parser library as a part of my project. I started with using the example in the documentation given to start a new project by doing the following:

const file  = project.getGmlFile("project.gml") // getGmlFile takes in a Pathy object not a string

// LSP information: (method) Project.getGmlFile(path: Pathy<any>): Code | undefined

The actual method contract specifies that it should use a Pathy object. Passing in a string throws this error message:

TypeError: path.relativeFrom is not a function

The documentation shows that a path to the .yyp file is needed, which differs from the actual implementation:

/ Get a GML file in its parsed state. Returns a Code instance,
// which includes various methods for querying/modifying them.
const code = project.getGmlFile(
  '/path/to/my/project/scripts/some_script/some_script.gml',
);

Metadata

Metadata

Assignees

Labels

🌳 parser📄 docsImprovements or additions to documentation🔥 bugSomething isn't working

Type

No type

Projects

Status
Inbox

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions