Skip to content

Activate the plugin on any ini file#1

Open
Wosi wants to merge 1 commit intodaviduuang:masterfrom
Wosi:patch-1
Open

Activate the plugin on any ini file#1
Wosi wants to merge 1 commit intodaviduuang:masterfrom
Wosi:patch-1

Conversation

@Wosi
Copy link

@Wosi Wosi commented Aug 23, 2018

The plugin only works properly for ´.ini´, ´.cfg´ and ´.reg´ files.
With these changes it will work for any file being opened with language mode = 'ini' (regardless its file extension).

The plugin only works properly for ´.ini´, ´.cfg´ and ´.reg´ files.
With these changes it will work for any file being opened with language mode = 'ini' (regardless its file extension).
@rbolsius
Copy link

rbolsius commented Jul 6, 2022

This fix in this pull request would be very welcomed. I have INI files on platforms with case-sensitive file systems that do not work with this extension because the file extension is uppercase (.INI) or even some other file extension that is not one of the default extensions.

Also, the fix could be simplified even further by just checking if the language is 'ini'. There is no need for the second line that also checks if the language is 'ini' and the scheme is 'untitled'. The following is sufficient to activate the extension for any INI document whether it is opened from a file or is an untitled/unsaved document:

function activate(context) {
    context.subscriptions.push(vscode.languages.registerDocumentSymbolProvider([
        { language: 'ini' },
    ], new documentSymbolProvider_1.IniDocumentSymbolProvider()));

    context.subscriptions.push(vscode.languages.registerFoldingRangeProvider([
        { language: 'ini' },
    ], new foldingRangeProvider_1.IniFoldingRangeProvider()));
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants