Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add failing/skipped test for https://github.com/microsoft/vscode/issues/191070 #200125

Merged
merged 2 commits into from
Dec 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,13 @@ export class SnippetCompletionProvider implements CompletionItemProvider {
async provideCompletionItems(model: ITextModel, position: Position, context: CompletionContext): Promise<CompletionList> {

const sw = new StopWatch();
const lineContentLow = model.getLineContent(position.lineNumber).toLowerCase();
const wordUntil = model.getWordUntilPosition(position).word.toLowerCase();

const languageId = this._getLanguageIdAtPosition(model, position);
const languageConfig = this._languageConfigurationService.getLanguageConfiguration(languageId);
const snippets = new Set(await this._snippets.getSnippets(languageId));

const lineContentLow = model.getLineContent(position.lineNumber).toLowerCase();
const wordUntil = model.getWordUntilPosition(position).word.toLowerCase();

const suggestions: SnippetCompletion[] = [];
const columnOffset = position.column - 1;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -819,4 +819,36 @@ suite('SnippetsService', function () {
const first = result.suggestions[0];
assert.strictEqual((<CompletionItemRanges>first.range).insert.startColumn, 5);
});

test.skip('Autocomplete suggests based on the last letter of a word and it depends on the typing speed #191070', async function () {
snippetService = new SimpleSnippetService([
new Snippet(false, ['fooLang'], '/whiletrue', '/whiletrue', '', 'one', '', SnippetSource.User, generateUuid()),
new Snippet(false, ['fooLang'], '/sc not expanding', '/sc not expanding', '', 'two', '', SnippetSource.User, generateUuid()),
]);

const provider = new SnippetCompletionProvider(languageService, snippetService, disposables.add(new TestLanguageConfigurationService()));
const model = disposables.add(instantiateTextModel(instantiationService, '', 'fooLang'));

{ // PREFIX: w
model.setValue('w');
const result1 = await provider.provideCompletionItems(
model,
new Position(1, 2),
{ triggerKind: CompletionTriggerKind.Invoke }
);
assert.strictEqual(result1.suggestions.length, 1);
assert.strictEqual(result1.suggestions[0].insertText, 'one');
}

{ // PREFIX: where
model.setValue('where');
const result2 = await provider.provideCompletionItems(
model,
new Position(1, 6),
{ triggerKind: CompletionTriggerKind.Invoke }
);
assert.strictEqual(result2.suggestions.length, 1);
assert.strictEqual(result2.suggestions[1].insertText, 'one'); // /whiletrue matches where (WHilEtRuE)
}
});
});
4 changes: 2 additions & 2 deletions test/unit/electron/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ const minimist = require('minimist');
* }}
*/
const args = minimist(process.argv.slice(2), {
string: ['grep', 'run', 'runGlob', 'dev', 'reporter', 'reporter-options', 'wait-server', 'timeout', 'crash-reporter-directory', 'tfs'],
boolean: ['build', 'coverage', 'help'],
string: ['grep', 'run', 'runGlob', 'reporter', 'reporter-options', 'wait-server', 'timeout', 'crash-reporter-directory', 'tfs'],
boolean: ['build', 'coverage', 'help', 'dev'],
alias: {
'grep': ['g', 'f'],
'runGlob': ['glob', 'runGrep'],
Expand Down