-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
lsp: Adds support for include paths and have {projectUri}/node_module…
…s added by default. - Factor out FileRepository's path resolving into own public function. - Fixes sourceUnitNameToUri() path resolving in relation to include paths being used. - Adding an solAssert(). - adds nother test for include-paths (bad include) - Fixes a case on Windows there an ill-formed URI was generated. - Dropping unnecessary if-branch when translating from sourceUnitName to URI.
- Loading branch information
1 parent
d003400
commit 31227e4
Showing
10 changed files
with
165 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// SPDX-License-Identifier: UNLICENSED | ||
pragma solidity >=0.8.0; | ||
|
||
import "my-module/test.sol"; | ||
|
||
contract MyContract | ||
{ | ||
function f(uint a, uint b) public pure returns (uint) | ||
{ | ||
return MyModule.add(a, b); | ||
} | ||
} | ||
// ---- | ||
// test: |
10 changes: 10 additions & 0 deletions
10
test/libsolidity/lsp/include-paths/file_at_include_path.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// SPDX-License-Identifier: UNLICENSED | ||
pragma solidity >=0.8.0; | ||
|
||
import "rootlib.sol"; | ||
|
||
contract MyContract | ||
{ | ||
} | ||
// ---- | ||
// rootlib: |
11 changes: 11 additions & 0 deletions
11
test/libsolidity/lsp/include-paths/file_not_found_in_searchpath.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// SPDX-License-Identifier: UNLICENSED | ||
pragma solidity >=0.8.0; | ||
|
||
import "test.sol"; | ||
// ^^^^^^^^^^^^^^^^^^ @IncludeLocation | ||
|
||
contract SomeContract | ||
{ | ||
} | ||
// ---- | ||
// file_not_found_in_searchpath: @IncludeLocation 6275 |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters