Skip to content

Commit 465d9fb

Browse files
committed
Add Crystal language to ignoreCompletionTrigger default configuration
1 parent 8fabaea commit 465d9fb

File tree

2 files changed

+51
-0
lines changed

2 files changed

+51
-0
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -632,6 +632,7 @@
632632
},
633633
"default": [
634634
"coffeescript",
635+
"crystal",
635636
"diff",
636637
"dockerfile",
637638
"dockercompose",
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
/*---------------------------------------------------------------------------------------------
2+
* Copyright (c) Microsoft Corporation. All rights reserved.
3+
* Licensed under the MIT License. See License.txt in the project root for license information.
4+
*--------------------------------------------------------------------------------------------*/
5+
6+
import { default as assert } from 'assert';
7+
import * as vscode from 'vscode';
8+
9+
describe('IssueCompletionProvider Configuration', function () {
10+
it('should include Crystal in default ignore completion trigger list', function () {
11+
// This test checks that the default configuration includes Crystal
12+
// We access this by examining the configuration contribution from package.json
13+
const config = vscode.workspace.getConfiguration('githubIssues');
14+
const defaultIgnoreList = config.inspect('ignoreCompletionTrigger')?.defaultValue as string[];
15+
16+
assert(Array.isArray(defaultIgnoreList), 'Default ignore list should be an array');
17+
assert(defaultIgnoreList.includes('crystal'), 'Default configuration should include Crystal language in ignore list');
18+
19+
// Also verify other expected languages are still there
20+
const expectedLanguages = ['python', 'ruby', 'perl', 'powershell', 'julia', 'coffeescript'];
21+
for (const language of expectedLanguages) {
22+
assert(defaultIgnoreList.includes(language), `Default configuration should include ${language} in ignore list`);
23+
}
24+
25+
// Verify the list is properly maintained in alphabetical order around crystal
26+
const crystalIndex = defaultIgnoreList.indexOf('crystal');
27+
const coffeeIndex = defaultIgnoreList.indexOf('coffeescript');
28+
const diffIndex = defaultIgnoreList.indexOf('diff');
29+
30+
assert(crystalIndex > coffeeIndex, 'Crystal should come after coffeescript alphabetically');
31+
assert(crystalIndex < diffIndex, 'Crystal should come before diff alphabetically');
32+
});
33+
34+
it('should verify ignored languages configuration structure', function () {
35+
const config = vscode.workspace.getConfiguration('githubIssues');
36+
const configInfo = config.inspect('ignoreCompletionTrigger');
37+
38+
// Verify that the configuration exists and has proper structure
39+
assert(configInfo, 'ignoreCompletionTrigger configuration should exist');
40+
assert(configInfo.defaultValue, 'Should have a default value');
41+
assert(Array.isArray(configInfo.defaultValue), 'Default value should be an array');
42+
43+
// Verify that crystal is in the list (this is the core fix)
44+
const defaultList = configInfo.defaultValue as string[];
45+
assert(defaultList.includes('crystal'), 'Crystal should be included in the default ignore list');
46+
47+
// Verify list has reasonable size (should have multiple languages)
48+
assert(defaultList.length > 10, 'Should have a reasonable number of ignored languages');
49+
});
50+
});

0 commit comments

Comments
 (0)