-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for
SymbolInformation.signature
Companion PRs: * sourcegraph/scip#231 * sourcegraph/cody#3142 Previously, scip-typescript didn't emit any structured information about signatures. This PR solves that problem, which unblocks new exciting use-cases for SCIP. Keeping this PR open for a while since we are not planning to merge signature support to SCIP just yet. For now, the Cody repo can use this branch instead.
- Loading branch information
Showing
33 changed files
with
7,397 additions
and
157 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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
{ | ||
"editor.formatOnSave": true | ||
"editor.formatOnSave": true, | ||
"editor.defaultFormatter": "esbenp.prettier-vscode" | ||
} |
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
14 changes: 14 additions & 0 deletions
14
snapshots/input/syntax/src/definition-file-signatures.d.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,14 @@ | ||
// format-options: showSignatures | ||
export namespace minimized { | ||
export enum NumericLiteralEnum { | ||
One = 1, | ||
TwoThousand = 2_000, | ||
} | ||
|
||
export const doubleConstant = 3.14 | ||
|
||
export enum StringLiteralEnum { | ||
Saturday = 'saturday', | ||
Sunday = 'sunday', | ||
} | ||
} |
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,4 @@ | ||
// format-options: showSignatures | ||
|
||
export type CompletionItemID = string & { _opaque: typeof CompletionItemID } | ||
declare const CompletionItemID: unique symbol |
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,99 @@ | ||
// format-options: showSignatures | ||
|
||
export type Requests = { | ||
'workspace/edit': [WorkspaceEditParams, boolean] | ||
'chat/submitMessage': [WorkspaceEditParams, boolean] | ||
} | ||
|
||
export type Notifications = { | ||
'workspace/edit': [WorkspaceEditParams] | ||
} | ||
|
||
export type Intersection = { uri: string } & { size: number } | ||
export type Union = { uri: string } | { size: number } | ||
export type Builtin = Pick<WorkspaceEditParams, 'changes'> | ||
export type Builtin2 = Partial<WorkspaceEditParams> | ||
export interface WorkspaceEditParams { | ||
changes: { uri: string }[] | ||
} | ||
|
||
export interface ExampleSuperInterface<T> { | ||
a: T | ||
b: string | ||
} | ||
export interface ExampleInterface<T> extends ExampleSuperInterface<T> { | ||
c: number | ||
} | ||
export class ExampleSuperClass<T> { | ||
constructor( | ||
public a: T, | ||
public b: string | ||
) {} | ||
} | ||
|
||
export class ExampleClass<T> | ||
extends ExampleSuperClass<T> | ||
implements ExampleSuperInterface<T>, ExampleInterface<T> | ||
{ | ||
public d: Record<string, any> | ||
|
||
#e = true | ||
|
||
constructor( | ||
public a: T, | ||
public b: string, | ||
public c: number, | ||
d: Record<string, any> | ||
) { | ||
super(a, b) | ||
this.d = d | ||
} | ||
public getC(): number { | ||
return this.c | ||
} | ||
|
||
get e(): boolean { | ||
return this.#e | ||
} | ||
|
||
set setB(b: string) { | ||
this.#e = true | ||
this.b = b | ||
} | ||
} | ||
|
||
export function basicFunction<T>(a: T, b: number): string { | ||
return `${a}${b}` | ||
} | ||
export const constant = 42 | ||
export const variable: <T>(a: T, b: number) => string = (a, b) => `${a}${b}` | ||
|
||
export interface User { | ||
name: string | ||
age: number | ||
customHeaders: Record<string, string> | ||
} | ||
|
||
export interface ChatHistory { | ||
chatID: User | ||
[a: number]: User | ||
[_: string]: User | ||
} | ||
|
||
export class ModelProvider { | ||
default = true | ||
} | ||
|
||
export enum NumericLiteralEnum { | ||
MinusOne = -1, | ||
Expression = 1 + 23 - 2, | ||
One = 1, | ||
TwoThousand = 2_000, | ||
} | ||
|
||
export const doubleConstant = 3.14 | ||
|
||
export enum StringLiteralEnum { | ||
Saturday = 'saturday', | ||
Sunday = 'sunday', | ||
} |
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
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
Oops, something went wrong.