@@ -17,6 +17,11 @@ interface McpConfig {
1717
1818const SERVER_KEY = 'Snyk' ;
1919
20+ // Gitignore patterns for IDE-specific rule files (always use forward slashes for Git compatibility)
21+ const COPILOT_GITIGNORE_PATTERN = '.github/instructions/snyk_rules.instructions.md' ;
22+ const WINDSURF_GITIGNORE_PATTERN = '.windsurf/rules/snyk_rules.md' ;
23+ const CURSOR_GITIGNORE_PATTERN = '.cursor/rules/snyk_rules.mdc' ;
24+
2025export async function configureMcpHosts ( vscodeContext : vscode . ExtensionContext , configuration : IConfiguration ) {
2126 const appName = vscode . env . appName . toLowerCase ( ) ;
2227 const isWindsurf = appName . includes ( 'windsurf' ) ;
@@ -88,7 +93,7 @@ export async function configureCopilot(vscodeContext: vscode.ExtensionContext, c
8893 }
8994 const rulesContent = await readBundledRules ( vscodeContext , secureAtInceptionExecutionFrequency ) ;
9095 await writeLocalRulesForIde ( filePath , rulesContent ) ;
91- await ensureInGitignore ( [ filePath ] ) ;
96+ await ensureInGitignore ( [ COPILOT_GITIGNORE_PATTERN ] ) ;
9297 } catch {
9398 Logger . error ( 'Failed to publish Copilot rules' ) ;
9499 }
@@ -123,7 +128,7 @@ export async function configureWindsurf(vscodeContext: vscode.ExtensionContext,
123128 }
124129 const rulesContent = await readBundledRules ( vscodeContext , secureAtInceptionExecutionFrequency ) ;
125130 await writeLocalRulesForIde ( localPath , rulesContent ) ;
126- await ensureInGitignore ( [ localPath ] ) ;
131+ await ensureInGitignore ( [ WINDSURF_GITIGNORE_PATTERN ] ) ;
127132 } catch {
128133 Logger . error ( 'Failed to publish Windsurf rules' ) ;
129134 }
@@ -155,7 +160,7 @@ export async function configureCursor(vscodeContext: vscode.ExtensionContext, co
155160
156161 const rulesContent = await readBundledRules ( vscodeContext , secureAtInceptionExecutionFrequency ) ;
157162 await writeLocalRulesForIde ( cursorRulesPath , rulesContent ) ;
158- await ensureInGitignore ( [ cursorRulesPath ] ) ;
163+ await ensureInGitignore ( [ CURSOR_GITIGNORE_PATTERN ] ) ;
159164 } catch {
160165 Logger . error ( 'Failed to publish Cursor rules' ) ;
161166 }
0 commit comments