Skip to content

Conversation

@ZacLN
Copy link
Contributor

@ZacLN ZacLN commented Feb 26, 2020

I think this is all that's needed on this side so that using statements will point to the 'live' code of packages that is being edited. Alongside the symbolserver store of packages I've added a new workspacepackages field which will be checked prior to the symbolserver list. It will be up to the user (e.g. the LanguageServerInstance) to ensure that this list is properly managed, I'll open a PR on the other side to discuss how this is managed.

Todo:

  • Add accessor function

Example code:

using StaticLint, SymbolServer, CSTParser
using StaticLint: File, FileServer, loadfile, scopepass

server = FileServer(Dict(), Set(), deepcopy(SymbolServer.stdlibs), Dict{String,CSTParser.EXPR}());
f = loadfile(server, String(first(methods(CSTParser.eval)).file))
scopepass(f)
server.workspacepackages["CSTParser"] = f.cst.meta.scope.names["CSTParser"] #Load the local/live version of CSTParser

s = """
using CSTParser
ParseState
"""
f = File("none", s, CSTParser.parse(s, true), nothing, server)
f.root = f
scopepass(f)
f.cst
# FileH  27(26) new scope
#  Using  16(15)
#   USING  6(5)
#   CSTParser  10(9) Binding(CSTParser(1 refs)) * 
#  ParseState  11(10)  * 

@ZacLN
Copy link
Contributor Author

ZacLN commented May 2, 2020

@davidanthoff could you have a look at this (and this on the LS side) now. Alongside whats described in first comment above there are some fixes for reference resolving (that were less apparent prior to this change).

@davidanthoff
Copy link
Member

@ZacLN what is the next step here? Probably for you to clean up merge conflicts, and then I review it?

@ZacLN
Copy link
Contributor Author

ZacLN commented Jul 21, 2021

Should be good to merge now, lets see what the tests say.

@davidanthoff
Copy link
Member

So main question is whether we try to put this in before Juliacon, or after? My sense is maybe after?

@davidanthoff
Copy link
Member

@ZacLN so I tried to fix this, there were some typos, but now I'm stuck :)

@pfitzseb
Copy link
Member

Tests should pass now. Would still be good if Zac can approve the PR though :)

@ZacLN
Copy link
Contributor Author

ZacLN commented Jul 26, 2021

Yes looks good (typof was a deprecated function rather than a typo)

@pfitzseb pfitzseb merged commit 5afcec0 into master Jul 26, 2021
@davidanthoff davidanthoff deleted the workspacepackags branch July 26, 2021 16:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants