GithubHelp home page GithubHelp logo

Comments (4)

dmnsgn avatar dmnsgn commented on May 19, 2024 1

Thanks for the suggestion.

the editor allows for TypeScript annotations but the compiler doesn't...

They are indeed two different systems. The editor is currently spawned for each node so its doesn't have any understanding of other nodes, their ports and how they are connected but I agree that having types for props would be helpful.

the editor offers to move the JSDoc types to TypeScript types

I actually never noticed, but that's a default suggestion as the editor parses the code as TypeScript for enhanced experience (even though it is not).

from nodes-io.

discohead avatar discohead commented on May 19, 2024

the editor offers to move the JSDoc types to TypeScript types

I actually never noticed, but that's a default suggestion as the editor parses the code as TypeScript for enhanced experience (even though it is not).

Since the editor is able to correctly translate JSDoc types to TypeScript types, then maybe it's possible to enable the autocomplete/intellisense features from JSDoc types?

FWIW, VSCode can do exactly that...
image

from nodes-io.

discohead avatar discohead commented on May 19, 2024

I see that Nodes is using Monaco for its editor, there seems to have been some discussion around this here, though it's not clear to me where it ended up: microsoft/monaco-editor#203

However, a couple of relevant StackOverflow threads seem to indicate it should work in Monaco from v0.9.0...
https://stackoverflow.com/questions/39694407/adding-javascript-type-hints-for-vscode-monaco-intellisence

https://stackoverflow.com/questions/43037243/provide-type-hints-to-monaco-editor

No luck using @type either, but again the editor offers to move it to TypeScript and can do so correctly...

image

from nodes-io.

discohead avatar discohead commented on May 19, 2024

@dmnsgn just wanted to make sure you saw my comments above, from what I can tell, the monaco-editor in Nodes should be able to provide intellisense from JSDocs. This was added in Monaco 0.9.0, seems it does require some options/config in monaco, see: https://stackoverflow.com/questions/43037243/provide-type-hints-to-monaco-editor/45181853#45181853

from nodes-io.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.