Omnisharp intellisense doesn't respect excluded folders

Viewed 200

I'm using localhistory extension in vscode, but every file created by this extension is scanned by omnisharp. Unfortunately when localhistory creates backup of file with error, intellisense show it. I tried to exclude .localhistory folder, but it didn't help.

omnisharp.json(global settings - stores in {user directory}/.omnisharp):

{
    "fileOptions": {
        "systemExcludeSearchPatterns": [
            "**/.history/**"
        ],
        "excludeSearchPatterns": [
            "**/.history/**"
        ]
    }
}
1 Answers

I don't know about OP problem, but this was the first thread that came up for my google search so I'm gonna give my 2 cents.

After losing a bit of time to a similar issue with our project, we discovered onmisharp doesn't like to exclude folders with Project files in them. ie. *.csproj

To give a bit of context, when I began contributing to a project I noticed there was and older project which I was told to simply 'Unload and leave it' in Visual Studio. When questioned about it, they said they left it for historical reference. Then after opening up the project folder in VS Code, omnisharp quickly blew up with all sorts of issues with this older project. Not wanting to look at the errors everyday, I wanted to exclude the folder from omnisharp. Ultimately this was only accomplished by appending an extension onto the unused .csproj file.

oldProject.csproj

change to...

oldProject.csproj.old

omnisharp immediately ignored the folder! (given I had already setup the whole omnisharp.json file)

Related