-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support unnamed function definition on documentSymbols
- Loading branch information
Showing
6 changed files
with
104 additions
and
24 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,8 +16,15 @@ | |
"bugs": { | ||
"url": "https://github.com/NomicFoundation/hardhat-vscode/issues" | ||
}, | ||
"_scripts_comment_": [ | ||
"To support the CI on testing an ugly hack is needed to force install the", | ||
"windows ia32 version of the solidity analyzer. This is the architecture", | ||
"that vscode extension host claims to run under, though the windows arch", | ||
"according to node will be x64. This hack is in the root package.json as", | ||
"a postinstall script.", | ||
"npm install --no-save --ignore-scripts --force @nomicfoundation/[email protected] @nomicfoundation/[email protected]" | ||
], | ||
"scripts": { | ||
"postinstall": "npm install --no-save --ignore-scripts --force @nomicfoundation/[email protected] @nomicfoundation/[email protected]", | ||
"build": "tsc -b ./client/tsconfig.json && tsc -b ./server/tsconfig.build.json && tsc -b ./coc/tsconfig.json && tsc -b", | ||
"watch": "concurrently -n client,server \"tsc -b -w ./client/tsconfig.json\" \"tsc -b -w ./server/tsconfig.build.json\"", | ||
"test:unit": "npm -w server run test", | ||
|
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
9 changes: 9 additions & 0 deletions
9
server/src/services/documentSymbol/visitors/UnnamedFunctionDefinition.ts
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,9 @@ | ||
import { SymbolKind } from "vscode-languageserver-types"; | ||
import { RuleKind, TokenKind } from "@nomicfoundation/slang/kinds"; | ||
import { SymbolVisitor } from "../SymbolVisitor"; | ||
|
||
export class UnnamedFunctionDefinition extends SymbolVisitor { | ||
public ruleKind = RuleKind.UnnamedFunctionDefinition; | ||
public symbolKind = SymbolKind.Function; | ||
public nameTokenKind = TokenKind.FunctionKeyword; | ||
} |
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
7 changes: 7 additions & 0 deletions
7
test/protocol/projects/projectless/src/documentSymbol/UnnamedFunction.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,7 @@ | ||
// SPDX-License-Identifier: GPL-3.0 | ||
|
||
pragma solidity 0.4.11; | ||
|
||
contract UnnamedTest { | ||
function() payable {} | ||
} |
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