Skip to content

Commit

Permalink
vscode: Use same solang for language server as for compilation on com…
Browse files Browse the repository at this point in the history
…mand line (#1554)

We've had complaints that the extension gives different errors and
warnings than solang on the command line. Use solang from the path and
only download solang if it can not be found.

Fixes #1444

Signed-off-by: Sean Young <[email protected]>
  • Loading branch information
seanyoung authored Sep 29, 2023
1 parent b972858 commit d6f73d3
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 12 deletions.
10 changes: 10 additions & 0 deletions vscode/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@

All notable changes to the "solang" extension will be documented in this file.

## Unreleased

- The same version of solang should be used by the language server as on the command line,
so first look in the $PATH for solang before downloading the solang binary. As a result, the
`forceSolangExecutable` option is no longer needed. [seanyoung](https://github.com/seanyoung)
- Go to definition, go to type definition, go to implementation is implemented. [chioni16](https://github.com/chioni16)
- Rename functionality is now implemented. [chioni16](https://github.com/chioni16)
- It is not longer necessary to save a Solidity file, in order for the language server to pick
up changes to the file. [chioni16](https://github.com/chioni16)

## [0.3.0]

- Ensure the extension still works without a connections to the internet
Expand Down
5 changes: 0 additions & 5 deletions vscode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,6 @@
"default": false,
"description": "Whether to ask for permission before downloading any files from the Internet"
},
"solang.forceSolangExecutable": {
"type": "string",
"default": "",
"description": "Use the executable at this path and do not download or update solang. Leave this empty for automatic download."
},
"solidity.trace.server": {
"scope": "window",
"type": "string",
Expand Down
12 changes: 5 additions & 7 deletions vscode/src/utils/getServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,12 @@ export default async function getServer(context: vscode.ExtensionContext): Promi
return undefined;
}

const local = config.get('forceSolangExecutable');
if (typeof local == 'string' && local) {
const ourVersion = executableVersion(local);
const local = 'solang';
const localVersion = executableVersion(local);

if (ourVersion) {
console.log("Local Solang version: " + ourVersion);
return local;
}
if (localVersion) {
console.log("Local Solang version: " + localVersion);
return local;
}

const dest = path.join(context.globalStoragePath, platform);
Expand Down

0 comments on commit d6f73d3

Please sign in to comment.