mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-30 01:04:49 -05:00
Add tests for completions crash (#53472)
This commit is contained in:
@@ -0,0 +1,69 @@
|
||||
/// <reference path="../fourslash.ts" />
|
||||
|
||||
// @Filename: /tsconfig.json
|
||||
//// {
|
||||
//// "compilerOptions": {
|
||||
//// "module": "nodenext"
|
||||
//// }
|
||||
//// }
|
||||
|
||||
// @Filename: /utils.ts
|
||||
//// export class Element {
|
||||
//// // ...
|
||||
//// }
|
||||
////
|
||||
//// export abstract class Component {
|
||||
//// abstract render(): Element;
|
||||
//// }
|
||||
|
||||
// @Filename: /classes.ts
|
||||
//// import { Component } from "./utils.js";
|
||||
////
|
||||
//// export class MyComponent extends Component {
|
||||
//// render/**/
|
||||
//// }
|
||||
|
||||
goTo.marker("");
|
||||
verify.completions({
|
||||
marker: "",
|
||||
isNewIdentifierLocation: true,
|
||||
preferences: {
|
||||
includeCompletionsWithInsertText: true,
|
||||
includeCompletionsWithSnippetText: true,
|
||||
includeCompletionsWithClassMemberSnippets: true,
|
||||
},
|
||||
includes: [
|
||||
{
|
||||
name: "render",
|
||||
sortText: completion.SortText.ClassMemberSnippets,
|
||||
isSnippet: true,
|
||||
insertText: "render(): Element {\r\n $0\r\n}",
|
||||
hasAction: true,
|
||||
source: completion.CompletionSource.ClassMemberSnippet,
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
goTo.file("/utils.ts");
|
||||
goTo.marker("");
|
||||
edit.backspace();
|
||||
|
||||
verify.completions({
|
||||
marker: "",
|
||||
isNewIdentifierLocation: true,
|
||||
preferences: {
|
||||
includeCompletionsWithInsertText: true,
|
||||
includeCompletionsWithSnippetText: true,
|
||||
includeCompletionsWithClassMemberSnippets: true,
|
||||
},
|
||||
includes: [
|
||||
{
|
||||
name: "render",
|
||||
sortText: completion.SortText.ClassMemberSnippets,
|
||||
isSnippet: true,
|
||||
insertText: "render(): Element {\r\n $0\r\n}",
|
||||
hasAction: true,
|
||||
source: completion.CompletionSource.ClassMemberSnippet,
|
||||
}
|
||||
]
|
||||
});
|
||||
Reference in New Issue
Block a user