Giter Club home page Giter Club logo

Comments (8)

ZacLN avatar ZacLN commented on May 16, 2024 1

Ok I've made progress following the hacky route... I delved into JuliaParser and your proposal there but found it a little too difficult to work with without getting to understand it in depth.

Combined with the partial document syncing I've got a mess of code that:

  • reads blocks from local files, tracks their location (and ~keeps AST line info correct)
  • re-parses only changed code blocks
  • manages to skip over broken blocks (i.e. failure to close functions)
  • tracks global variables added to the namespace
  • tracks some local variables/types in blocks
  • will update linter diagnostics only on changed blocks (currently commented out)

At the moment it simply spits out diagnostics on hover for what the block contains but it's pretty rudimentary to generate for each file:

  • a store of global vars allowing hovers/completions/signature help
  • a graph listing where functions defined in the curent document are called from
  • block specific hovers/completions/signature help for local vars given there is enough type information (i.e. relies on writing fairly explicit typed code)

I've not been able to work out how to send information on what the current project is to the server, any ideas?

from julia-vscode.

ZacLN avatar ZacLN commented on May 16, 2024

a simple implementation

from julia-vscode.

davidanthoff avatar davidanthoff commented on May 16, 2024

Yeah, I think this is definitely the right approach. I guess one question is whether these kinds of static analysis passes should be triggered per file, or whether the language server should parse the whole project folder and then cache things...

Also, see this. I'm not sure what the best way forward is on this. It would clearly be best if JuliaParser could somehow be utilized in all of this, but I think right now it simply doesn't spit out all the information that would be needed for a fully functional static analysis/editor plugin. I do think that the whole Roslyn architecture is a really good guide, but it is a lot of work.

So I think I'm in favor of anything that makes progress right now, whether it is the "big" solution, or some more hacky things.

from julia-vscode.

ZacLN avatar ZacLN commented on May 16, 2024

Thinking about how the TypeScript project scope system works it must just add documents that are referenced by the current open ones (i.e. in Julia search blocks for those calling include) but this would only make #29 worse

from julia-vscode.

davidanthoff avatar davidanthoff commented on May 16, 2024

I've not been able to work out how to send information on what the current project is to the server, any ideas?

I think the initialize request sends the rootPath, that would probably be the info to use?

Same for the linter problem, I think we could just limit linting to files that are children of rootPath?

I'm not clear right now what happens if one opens a new folder. Is the language server restarted? Or would we get a shutdown request, and then another initialize?

from julia-vscode.

ZacLN avatar ZacLN commented on May 16, 2024

Great, I've added this to the LanguageServer.

On the opening a new folder a new instance of vscode is started I think.

from julia-vscode.

davidanthoff avatar davidanthoff commented on May 16, 2024

@ZacLN I'll close this, you essentially did this for v0.6.0, right?

from julia-vscode.

ZacLN avatar ZacLN commented on May 16, 2024

Yep this is the CSTParser stuff

from julia-vscode.

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.