It is easy to configure Visual Studio Code to your liking through its various settings. Nearly every part of VS Code's editor, user interface, and functional behavior has options you can modify.
VS Code provides two different scopes for settings:
Workspace settings override user settings. Workspace settings are specific to a project and can be shared across developers on a project.
Note: A VS Code "workspace" is usually just your project root folder
To open your user and workspace settings, use the following VS Code menu command:
File > Preferences > SettingsCode > Preferences > SettingsYou can also open the Settings editor from the Command Palette (Ctrl+Shift+P) with Preferences: Open Settings or use the keyboard shortcut (Ctrl+,).
Read more about settings in VSCode in VSCode documentation
FSharp.fsac.attachDebuggerAppends the '--attachdebugger' argument to fsac, this will allow you to attach a debugger.
Type: bool
Default: false
FSharp.fsac.cachedTypeCheckCountThe MemoryCacheOptions.SizeLimit for caching typechecks.
Type: integer
Default: 200
FSharp.fsac.conserveMemory (Deprecated use FSharp.fsac.gc.conserveMemory)This will set DOTNET_GCConserveMemory. Requires restart.
Type: bool
Default: false
FSharp.fsac.dotnetArgsAdditional CLI arguments that will be provided to the dotnet runtime when running FSAC. These are fully described at the official Microsoft documentation, and in general relate to which runtime FSAC is run on.
Type: string []
Default: ["--roll-forward", "LatestMajor"] or []
If FSAC is launched from a directory that has a global.json whose sdk.version is 6.0 or greater, or if the 6.0 SDK is installed and no global.json is present, the --roll-forward LatestMajor arguments will be added to ensure FSAC runs under .net 6 (required to support MSBuild correctly).
Otherwise no arguments are automatically supplied by Ionide.
FSharp.fsac.gc.conserveMemoryConfigures the garbage collector to conserve memory at the expense of more frequent garbage collections and possibly longer pause times. Acceptable values are 0-9. Any non-zero value will allow the Large Object Heap to be compacted automatically if it has too much fragmentation. Requires restart.
Type: integer (0-9)
FSharp.fsac.gc.heapCountLimits the number of heaps created by the garbage collector. Applies to server garbage collection only. See Middle Ground between Server and Workstation GC for more details. This can allow FSAC to still benefit from Server garbage collection while still limiting the number of heaps. Requires restart
Type: integer
Default: 2
Fsharp.fsac.gc.noAffinitizeSpecifies whether to affinitize garbage collection threads with processors. To affinitize a GC thread means that it can only run on its specific CPU.. Applies to server garbage collection only. See GCNoAffinitize for more details. Requires restart.
Type: boolean
Default: true
FSharp.fsac.gc.serverConfigures whether the application uses workstation garbage collection or server garbage collection. See Workstation vs Server Garbage Collection for more details. Workstation will use less memory but Server will have more throughput. Requires restart.
Type: boolean
Default: true
FSharp.fsac.netCoreDllPathThe path to the fsautocomplete.dll, useful for debugging a self-built fsac.
Type: string
Default:
FSharp.fsac.silencedLogsAn array of log categories for FSAC to filter out. These can be found by viewing your log output and noting the text in between the brackets in the log line. For example, in the log line [16:07:14.626 INF] [Compiler] done compiling foo.fsx, the category is 'Compiler'.
Type: string []
Default: [ ]
FSharp.fsac.sourceTextImplementationEXPERIMENTAL. Enables the use of a new source text implementation. This may have better memory characteristics. Requires restart.
Type: enum
Default NamedText
Possible Values:
NamedText - The default source text implementation.RoslynSourceText - A new source text implementation based on Roslyn's implementation. May perform better for bigger files.FSharp.workspaceModePeekDeepLevelThe deep level of directory hierarchy when searching for sln/projects
Type: int
Default: 4
FSharp.fsiFilePathThe path to the F# Interactive tool used by Ionide-FSharp (.NET framework only, on .NET Core FSharp.fsiSdkFilePath is used)
Type: string
Default:
FSharp.fsiSdkFilePathThe path to the F# Interactive tool used by Ionide-FSharp (when using .NET SDK scripts)
Type: string
Default:
FSharp.keywordsAutocompleteIncludes keywords in autocomplete
Type: bool
Default: true
FSharp.externalAutocompleteIncludes external (from unopened modules and namespaces) symbols in autocomplete
Type: bool
Default: false
FSharp.linterEnables integration with FSharpLint for additional (user-defined) warnings
Type: bool
Default: true
FSharp.unionCaseStubGenerationEnables a codefix that generates missing union cases when in a match expression
Type: bool
Default: true
FSharp.unionCaseStubGenerationBodyThe expression to fill in the right-hand side of match cases when generating missing cases for a match on a discriminated union
Type: string
Default: failwith \"Not Implemented\"
FSharp.recordStubGenerationEnables a codefix that will generate missing record fields when inside a record construction expression
Type: bool
Default: true
FSharp.recordStubGenerationBodyThe expression to fill in the right-hand side of record fields when generating missing fields for a record construction expression
Type: string
Default: failwith \"Not Implemented\"
FSharp.interfaceStubGenerationEnables a codefix that generates missing interface members when inside of an interface implementation expression
Type: bool
Default: true
FSharp.interfaceStubGenerationMethodBodyThe expression to fill in the right-hand side of interface members when generating missing members for an interface implementation expression
Type: string
Default: failwith \"Not Implemented\"
FSharp.interfaceStubGenerationObjectIdentifierThe name of the 'self' identifier in an interface member. For example, this in the expression this.Member(x: int) = ()
Type: string
Default: this
FSharp.abstractClassStubGenerationEnables a codefix that generates missing members for an abstract class when in an type inheriting from that abstract class.
Type: boolean
Default: true
FSharp.abstractClassStubGenerationObjectIdentifierThe name of the 'self' identifier in an inherited member. For example, this in the expression this.Member(x: int) = ()
Type: string
Default: this
FSharp.abstractClassStubGenerationMethodBodyThe expression to fill in the right-hand side of inherited members when generating missing members for an abstract base class
Type: string
Default: failwith \"Not Implemented\"
FSharp.unusedOpensAnalyzerEnables detection of unused opens
Type: bool
Default: true
FSharp.unusedDeclarationsAnalyzerEnables detection of unused declarations
Type: bool
Default: true
FSharp.simplifyNameAnalyzerEnables detection of cases when names of functions and values can be simplified
Type: bool
Default: true
FSharp.fsiExtraParametersAn array of additional command line parameters to pass to FSI when it is started. See the documentation for an exhaustive list.
Type: array
Default: []
FSharp.saveOnSendLastSelectionIf enabled, the current file will be saved before sending the last selection to FSI for evaluation
Type: bool
Default: false
FSharp.msbuildAutoshowAutomatically shows the MSBuild output panel when MSBuild functionality is invoked
Type: bool
Default: false
FSharp.resolveNamespacesEnables a codefix that will suggest namespaces or module to open when a name is not recognized
Type: bool
Default: true
FSharp.addPrivateAccessModifierEnables a codefix that adds a private access modifier
Type: bool
Default: false
FSharp.enableTreeViewEnables the solution explorer view of the current workspace, which shows the workspace as MSBuild sees it
Type: bool
Default: true
FSharp.excludeProjectDirectoriesDirectories in the array are excluded from project file search. Requires restart.
Type: array
Default: [".git","paket-files",".fable","packages","node_modules"]
FSharp.lineLens.enabledUsage mode for LineLens. If never, LineLens will never be shown. If replaceCodeLens, LineLens will be placed in a decoration on top of the current line.
Type: enum
Possible values:
neverreplaceCodeLensalwaysDefault: replaceCodeLens
FSharp.lineLens.prefixThe prefix displayed before the signature in a LineLens
Type: string
Default: //
FSharp.disableFailedProjectNotificationsDisables popup notifications for failed project loading
Type: bool
Default: false
FSharp.enableAdaptiveLspServerEXPERIMENTAL. Enables LSP Server based on FSharp.Data.Adaptive. This can improve stability. Requires restart.
Type: boolean
Default: false
FSharp.enableBackgroundServicesEnables background services responsible for creating symbol cache and typechecking files in the background. Requires restart.
Type: bool
Default: true
FSharp.enableMSBuildProjectGraphEXPERIMENTAL. Enables support for loading workspaces with MsBuild's ProjectGraph. This can improve load times. Requires restart.
Type: boolean
Default: false
FSharp.enableReferenceCodeLensEnables additional code lenses showing number of references of a function or value. Requires background services to be enabled.
Type: bool
Default: true
FSharp.showProjectExplorerInSet the activity (left bar) where the project explorer view will be displayed. If explorer, then the project explorer will be a collapsible tab in the main explorer view, a sibling to the file system explorer. If fsharp, a new activity with the F# logo will be added and the project explorer will be rendered in this activity.Requires restart.
Type: enum
Possible values:
explorerfsharpDefault: fsharp
FSharp.enableAnalyzersEXPERIMENTAL. Enables F# analyzers for custom code diagnostics. Requires restart.
Type: bool
Default: false
FSharp.analyzersPathDirectories in the array are used as a source of custom analyzers. Requires restart.
Type: array
Default: ["packages/Analyzers", "analyzers"]
FSharp.workspacePathPath to the directory or solution file that should be loaded as a workspace. If set, no workspace probing or discovery is done by Ionide at all.
Type: string
FSharp.showExplorerOnStartupAutomatically shows solution explorer on plugin startup
Type: bool
Default: true
FSharp.enableTouchBarEnables TouchBar integration of build/run/debug buttons
Type: bool
Default: true
FSharp.autoRevealInExplorerControls whether the solution explorer should automatically reveal and select files when opening them. If sameAsFileExplorer is set, then the value of the explorer.autoReveal setting will be used instead.
Type: enum
Possible values:
sameAsFileExplorerenableddisabledDefault: sameAsFileExplorer
FSharp.smartIndentEnables smart indent feature
Type: bool
Default: false
FSharp.infoPanelUpdateControls when the info panel is updated
Type: enum
Possible values:
onCursorMoveonHoverbothnoneDefault: onCursorMove
FSharp.infoPanelReplaceHoverControls whether the info panel replaces tooltips
Type: bool
Default: false
FSharp.infoPanelStartLockedControls whether the info panel should be locked at startup
Type: bool
Default: false
FSharp.infoPanelShowOnStartupControls whether the info panel should be displayed at startup
Type: bool
Default: false
FSharp.verboseLoggingLogs additional information to F# output channel. This is equivalent to passing the --verbose flag to FSAC. Requires restart.
Type: bool
Default: false
FSharp.notifications.traceEnables more verbose notifications using System.Diagnostics.Activity to view traces from FSharp.Compiler.Service.
Type: bool
Default: false
FSharp.notifications.traceNamespacesThe set of System.Diagnostics.Activity names to watch.
Type: string array
Default:
[
"BoundModel.TypeCheck",
"BackgroundCompiler."
]
FAKE.targetsOutlineEnables the Targets Outline tree view.
Type: bool
Default: true
FAKE.showTargetsOutlineInSet the activity (left bar) where the FAKE targets outline view will be displayed.Requires restart.
Type: enum
Possible values:
explorerfsharpDefault: explorer
FSharp.suggestGitignoreAllow Ionide to prompt whenever internal data files aren't included in your project's .gitignore
Type: bool
Default: true
FSharp.suggestSdkScriptsAllow Ionide to suggest using .NET SDK FSI for scripting instead of .NET Framework FSI
Type: boolean
Default: true
FSharp.useSdkScriptsUse dotnet fsi instead of fsi.exe/fsharpi to start an FSI session
Type: boolean
Default: true
FSharp.dotnetRootSets the root path for finding locating the dotnet CLI binary. Defaults to the dotnet binary found on your system PATH.
Type: string
FSharp.addFsiWatcherEnables a panel for FSI that shows the value of all existing bindings in the FSI session
Type: boolean
Default: false
FSharp.generateBinLogEnables generation of msbuild.binlog files for project loading. It works only for fresh, non-cached project loading. Run F#: Clear Project Cache and reload window to force fresh loading of all projects. These files can be loaded and inspected using the MSBuild Structured Logger
Type: boolean
Default: false
FSharp.pipelineHints.enabledEnables pipeline hints, which are like LineLenses that appear along each step of a chain of piped expressions
Type: boolean
Default: true
FSharp.pipelineHints.prefixThe prefix displayed before the signature of a pipeline hint
Type: string
Default: //
FSharp.inlayHints.enabledControls if the inlay hints feature is enabled.
Type: boolean
Default: true
Fsharp.inlayHints.parameterNamesControls if parmaeter-name inlay hints will be displayed for functions and methods.
Type: boolean
Default: true
FSharp.inlayHints.typeAnnotationsControls if type-annotation inlay hitns will be displayed for bindings.
Type: boolean
Default: true
VS Code allows for very deep theming and customization, and Ionide plugs into this system excellently. The Language Server performs advanced syntax highlighting and annotates the source code with semantic tokens and modifiers. These tokens and modifiers can be themed individually in whatever way you want. For a deep dive on semantic tokens, including how to find out which tokens and modifiers have been applied to source code that you want to theme, please see the official documentation.
In addition to the standard set of tokens and modifiers shown on that documentation, Ionide provides several custom scopes and modifiers:
member- used in mutable vars and record fields, as well as exceptions, fields, events, delegates, and named argumentscexpr - for computation expressionstext - for plaintext stringsmutable - for any values that are defined as let mutabledisposable - for any values that implement System.IDisposableLike all settings, theme customizations are stored in settings files, which are described at the top of this page in greater detail.
Semantic tokens can be overidden on a theme-by-theme basis in the following way:
{
"editor.semanticTokenColorCustomizations": {
"[Default Dark+]": {
"enabled": true,
"rules": {
"*.mutable": {
"foreground": "#FF0000",
"fontStyle": "underline",
},
"*.disposable": {
"foreground": "#ff8b2c",
"fontStyle": "bold"
}
}
}
}
}
A few things to note about this example:
rules are a map of scope or modifier to the theme settings to be applied to tokens that matchrule can be
<scope>.<modifier>, for example member.mutable)member)*.mutable to apply to all mutables, regardless of scope)Here are settings recommended for larger projects to help with performance.
{
"FSharp.codeLenses.references.enabled": false,
"FSharp.enableMSBuildProjectGraph": true,
"FSharp.enableAdaptiveLspServer": true,
"FSharp.fsac.gc.conserveMemory": 9
}
FSharp.codeLenses.references.enabled - Recommend disabling this because it requires typechecks of your whole solution.FSharp.enableMSBuildProjectGraph - Recommend enabling this because it can speed up project load times for larger project graphs.FSharp.enableAdaptiveLspServer - Recommended enabling this because it has more stable state management.FSharp.fsac.gc.conserveMemory - Recommended enabling this because it will tell dotnet compact Large Object Heap allocations.