-
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
96 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 |
---|---|---|
|
@@ -17,7 +17,6 @@ | |
"url": "https://github.com/NomicFoundation/hardhat-vscode/issues" | ||
}, | ||
"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