Comments (3)
Whoops, apparently we don't use DsGrids in any of our projects!
The accessor fix will be in the next version (after 1.3.2) by end of day Central Time.
I'm not sure why the global is ending up with an Any
type, though using global.X
is challenging for the parser since it's not possible to determine which global.X =
assignment is the initial declaration (Stitch uses the declaration, or the first discovered assignment to determine the type).
If you use globalvar
to declare them that might resolve it, since that unambiguously indicates where the declaration of that variable is.
from stitch.
Yeah the global thing is just sorta incompatible with static analysis, unfortunately.
Since Stitch only assigns types when things are assigned, you should be able to ensure that a type is correct for a given global.X
if you:
- Find each assignment for that global
global.X = ...
- Above each, add a
/// @type {TheType}
JSDoc above it (this is a Stitch extension to Feather's JSDocs)
Stitch gives the /// @type {TheType}
directive precedence over inferred types, so as long as you can ensure that the first assignment Stitch sees is explicitly typed like that (by explicitly typing all assignments) you should end up with what you want.
Note that Stitch works from top to bottom on files, so you would only need to explicitly type a global's first assignment in a given file.
The latest version (1.4.0) was just published a moment ago and includes the DsGrid accessor fix, among a bunch of other fixes.
from stitch.
This is great! Unfortunately we're using global.STUFF
to define all of our global variables and we may not be able to change them right now, but that's okay, "Find References" works on global and in most cases I know the types already. Thank you for all the help and fixes!
from stitch.
Related Issues (20)
- Uninformative error: `StitchParserError: Cannot replace existing member with new member`
- The new yyp format has all of the resources sorted alphabetically. Stitch should also format things that way. HOT 1
- Add a "runner" panel in Stitch VSCode HOT 1
- Runner Panel: Add customizable color-coding HOT 1
- Renaming a script resource causes the project to be unable to run.
- Cannot convert 1E-10 to a Bigint HOT 1
- Hiding variables marked with @access JSDOC. HOT 3
- Add "New Project" command HOT 1
- Symbol searcher: can we go directly to sounds?
- Create Room assets from VSCode
- Add object instances to a room via VSCode HOT 1
- Audio assets cannot be added to new folders HOT 2
- "Set Sprite" dropdown menu in the Object Inspector tab doesn't set the sprite.
- Renaming an object doesn't rename it in the rooms that object is placed in. HOT 1
- Can't create collision events on objects from VS Code, adding them from Game Maker makes name of event invisible in VS Code HOT 1
- F2 Shortcut to Rename Resource Doesn't Open Rename Text Prompt HOT 2
- Drag-and-drop to create new Sprites no longer generates a correct .yy file, resulting in a failure to compile. HOT 1
- Stitch does not recognise project HOT 2
- Object events in a single window HOT 1
- Would you consider publishing this extension to Open VSX so that VSCodium users can access the extension easily? 🙏 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from stitch.