Comments (8)
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.
a simple implementation
from julia-vscode.
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.
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.
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.
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.
@ZacLN I'll close this, you essentially did this for v0.6.0, right?
from julia-vscode.
Yep this is the CSTParser stuff
from julia-vscode.
Related Issues (20)
- the prerelease extension is not available for installation when using OpenVSX
- False `UnusedTypeParameter` Warning HOT 2
- Can't load Cthulhu inside vs-code REPL HOT 5
- Julia 1.11: Issues if REPLExt is not in global env HOT 1
- Julia 1.11: Stackoverflow in package_callbacks because of require calls
- neovim: LspFailed after external juliaup update command
- Julia VS code can't find abstract type definition
- Linter reports missing reference for assignments within `while` block condition
- additionalArgs evaluation changed?
- error status not cleared after successful evaluation HOT 1
- How to activate a Python environment before Julia: Start REPL HOT 5
- v1.73.2 breaks environment handling in Julia startup script HOT 2
- "\641" anywhere in docstring crashes language server when hovering over the function
- Ctrl+C not working with ProgressLogging HOT 5
- Incorrect type inference when destructing struct into named tuple
- Debugger crashes with AssertionError: !(is_generated(method)) HOT 2
- Where are `.JuliaFormatter.toml` files searched for? HOT 10
- Handle `\r` in the notebook HOT 1
- ParseError when using question mark operator "?" for help HOT 2
- Incorrect linter output in `@eval` block
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 julia-vscode.