-
Notifications
You must be signed in to change notification settings - Fork 12.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support completions that require changing from dot to bracket access
- Loading branch information
Andy Hanson
committed
Dec 8, 2017
1 parent
5e5b770
commit 53bc018
Showing
8 changed files
with
249 additions
and
254 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
Large diffs are not rendered by default.
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
21 changes: 15 additions & 6 deletions
21
tests/cases/fourslash/completionListInvalidMemberNames2.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 |
---|---|---|
@@ -1,10 +1,19 @@ | ||
/// <reference path='fourslash.ts' /> | ||
|
||
////enum Foo { | ||
//// X, Y, '☆' | ||
// TODO: we should probably support this like we do in completionListInvalidMemberNames.ts | ||
|
||
////declare var Symbol: SymbolConstructor; | ||
////interface SymbolConstructor { | ||
//// readonly hasInstance: symbol; | ||
////} | ||
////interface Function { | ||
//// [Symbol.hasInstance](value: any): boolean; | ||
////} | ||
////interface SomeInterface { | ||
//// (value: number): any; | ||
////} | ||
////Foo./*a*/; | ||
////Foo["/*b*/"]; | ||
////var _ : SomeInterface; | ||
////_./**/ | ||
|
||
verify.completionsAt("a", ["X", "Y"]); | ||
verify.completionsAt("b", ["X", "Y", "☆"]); | ||
goTo.marker(); | ||
verify.not.completionListContains("[Symbol.hasInstance]"); |
71 changes: 0 additions & 71 deletions
71
tests/cases/fourslash/completionListInvalidMemberNames3.ts
This file was deleted.
Oops, something went wrong.
11 changes: 11 additions & 0 deletions
11
tests/cases/fourslash/completionListInvalidMemberNames_withExistingIdentifier.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,11 @@ | ||
/// <reference path='fourslash.ts' /> | ||
|
||
////declare const x: { "foo ": "space in the name", }; | ||
////[|x.fo/**/;|] | ||
|
||
verify.completionsAt("", ["foo "]); | ||
verify.applyCodeActionFromCompletion("", { | ||
name: "foo ", | ||
description: "Use bracket notation instead of dot notation", | ||
newRangeContent: 'x["fo"];', | ||
}); |
13 changes: 0 additions & 13 deletions
13
...urslash/completion_enum-members-with-invalid-identifiers-should-not-show-in-completion.ts
This file was deleted.
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