@RLovelett Hi. When I started adding support for non-SPM projects in SDE, I started by just including the requested document within the requests. => no error messages and basic functionality within single files.
In case of langserver-swift there would be two workarounds:
WorkspaceError.notFound
has been thrown, catch it and pass just the document as source. Not sure how many parts would need to be changed.WorkspaceError.notFound
, we would return a temporary SwiftModule
containing just the document. But if we would add proper support for non-SPM projects, we might want this error back again. Even if we just want to present a warning.What do you think? Happy to submit a PR.
WorkspaceError
. My implementation tried to determine based on files present and organization if it was an SPM module or not. I think your idea of being SPM first and then if that fails be something else is a much better approach.
Apple will even provide a VS Code extension and Sublime instructions. Seems like I can start to implement migration features in SDE.
Linking ./.build/x86_64-apple-macosx10.10/debug/Configure
Compile Swift Module 'Arguments' (1 sources)
Index: Duplicate USR! s:9ArgumentsAAV7FailureO4nameSSvg
Index: Duplicate USR! s:9ArgumentsAAV7FailureO4nameSSvp
Index: Duplicate USR! s:9ArgumentsAAV7FailureO4nameSSvs
Swift (Swift IDE) rpc.sendNotification textDocument/didChange {textDocument: {…}, contentChanges: Array(1)}
logger.js:33 Swift (Swift IDE) rpc.sendRequest textDocument/completion sending {textDocument: {…}, position: {…}, context: {…}}context: {triggerKind: 2, triggerCharacter: "s"}position: {line: 55, character: 18}textDocument: {uri: "file:///Users/sam/.local/share/xpkg/code/Sources/XPkgCommand/main.swift"}proto: Object
logger.js:33 Swift (Swift IDE) rpc.sendRequest textDocument/completion received (7ms) {items: Array(0), isIncomplete: false}isIncomplete: falseitems: []proto: Object
logger.js:33 Swift (Swift IDE) rpc.sendRequest textDocument/documentHighlight sending {textDocument: {…}, position: {…}}
logger.js:33 Swift (Swift IDE) rpc.sendRequest textDocument/documentHighlight received (1ms)
logger.js:33 Swift (Swift IDE) rpc.sendRequest textDocument/hover sending {textDocument: {…}, position: {…}}
logger.js:33 Swift (Swift IDE) rpc.sendRequest textDocument/hover received (1ms)
logger.js:33 Swift (Swift IDE) rpc.sendRequest textDocument/hover sending {textDocument: {…}, position: {…}}
logger.js:33 Swift (Swift IDE) rpc.sendRequest textDocument/hover received (0ms)
logger.js:33 Swift (Swift IDE) rpc.sendRequest textDocument/hover sending {textDocument: {…}, position: {…}}
logger.js:33 Swift (Swift IDE) rpc.sendRequest textDocument/hover received (0ms)
logger.js:33 Swift (Swift IDE) rpc.sendRequest textDocument/hover sending {textDocument: {…}, position: {…}}
logger.js:33 Swift (Swift IDE) rpc.sendRequest textDocument/hover received (0ms)