Skip to content

Instantly share code, notes, and snippets.

@bishabosha
Created September 25, 2025 09:46
Show Gist options
  • Select an option

  • Save bishabosha/6ba67dc626f68b60f5979e206fe4ef26 to your computer and use it in GitHub Desktop.

Select an option

Save bishabosha/6ba67dc626f68b60f5979e206fe4ef26 to your computer and use it in GitHub Desktop.
Scala BBEdit Module with metals LSP
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<!-- Enhanced Scala Codeless Language Module for BBEdit
Supports advanced syntax highlighting, folding, function indexing, and Metals LSP -->
<dict>
<!-- You must identify the plist as a CLM: -->
<key>BBEditDocumentType</key>
<string>CodelessLanguageModule</string>
<!-- You must identify your language: -->
<key>BBLMLanguageDisplayName</key>
<string>Scala</string>
<key>BBLMLanguageCode</key>
<string>Scal</string>
<!-- File extensions this language module handles -->
<key>BBLMSuffixMap</key>
<array>
<dict>
<key>BBLMLanguageSuffix</key>
<string>.scala</string>
</dict>
<dict>
<key>BBLMLanguageSuffix</key>
<string>.sc</string>
</dict>
<dict>
<key>BBLMLanguageSuffix</key>
<string>.sbt</string>
</dict>
<dict>
<key>BBLMLanguageSuffix</key>
<string>.mill</string>
</dict>
</array>
<!-- Enable syntax coloring -->
<key>BBLMColorsSyntax</key>
<true/>
<!-- Case sensitivity -->
<key>BBLMIsCaseSensitive</key>
<true/>
<!-- Enable function scanning -->
<key>BBLMScansFunctions</key>
<true/>
<!-- Enable text completion -->
<key>BBLMSupportsTextCompletion</key>
<true/>
<!-- Enable spell checking in comments only -->
<key>BBLMCanSpellCheckCodeRuns</key>
<false/>
<!-- Language Server Protocol Configuration -->
<key>BBLMLanguageServerOptions</key>
<dict>
<key>BBLMLanguageServerEnabled</key>
<true/>
<key>BBLMLanguageServerCommand</key>
<!-- if not on the PATH then configure manual override in BBEdit settings -->
<string>metals</string>
<key>BBLMLanguageServerArguments</key>
<array>
<!-- Metals will be started without additional arguments -->
</array>
<key>BBLMLanguageServerEnvironment</key>
<dict>
<!-- Set any environment variables if needed -->
</dict>
<key>BBLMLanguageServerWorkingDirectory</key>
<string></string>
<!-- Language Server capabilities -->
<key>BBLMLanguageServerCapabilities</key>
<dict>
<key>textDocumentSync</key>
<integer>2</integer>
<key>hoverProvider</key>
<true/>
<key>completionProvider</key>
<dict>
<key>resolveProvider</key>
<true/>
<key>triggerCharacters</key>
<array>
<string>.</string>
<string>:</string>
</array>
</dict>
<key>signatureHelpProvider</key>
<dict>
<key>triggerCharacters</key>
<array>
<string>(</string>
<string>,</string>
</array>
</dict>
<key>definitionProvider</key>
<true/>
<key>referencesProvider</key>
<true/>
<key>documentHighlightProvider</key>
<true/>
<key>documentSymbolProvider</key>
<true/>
<key>workspaceSymbolProvider</key>
<true/>
<key>codeActionProvider</key>
<true/>
<key>codeLensProvider</key>
<dict>
<key>resolveProvider</key>
<true/>
</dict>
<key>documentFormattingProvider</key>
<true/>
<key>documentRangeFormattingProvider</key>
<true/>
<key>renameProvider</key>
<true/>
<key>foldingRangeProvider</key>
<true/>
</dict>
<!-- File watching patterns for Metals -->
<key>BBLMLanguageServerWatchedFiles</key>
<array>
<string>**/*.scala</string>
<string>**/*.sbt</string>
<string>**/*.sc</string>
<string>**/build.sbt</string>
<string>**/project/*.scala</string>
<string>**/project/build.properties</string>
<string>**/project/plugins.sbt</string>
<string>**/.metals/**</string>
</array>
</dict>
<!-- Keywords to highlight -->
<key>BBLMKeywordList</key>
<array>
<string>abstract</string>
<string>case</string>
<string>catch</string>
<string>class</string>
<string>def</string>
<string>do</string>
<string>else</string>
<string>extends</string>
<string>false</string>
<string>final</string>
<string>finally</string>
<string>for</string>
<string>forSome</string>
<string>if</string>
<string>implicit</string>
<string>import</string>
<string>lazy</string>
<string>match</string>
<string>new</string>
<string>null</string>
<string>object</string>
<string>override</string>
<string>package</string>
<string>private</string>
<string>protected</string>
<string>return</string>
<string>sealed</string>
<string>super</string>
<string>this</string>
<string>throw</string>
<string>trait</string>
<string>true</string>
<string>try</string>
<string>type</string>
<string>val</string>
<string>var</string>
<string>while</string>
<string>with</string>
<string>yield</string>
<!-- Scala 3 keywords -->
<string>using</string>
<string>given</string>
<string>extension</string>
<string>enum</string>
<string>export</string>
<string>then</string>
<string>end</string>
<string>derives</string>
<string>transparent</string>
<string>inline</string>
<string>opaque</string>
</array>
<!-- Predefined names (built-in types and common identifiers) -->
<key>BBLMPredefinedNameList</key>
<array>
<string>String</string>
<string>Int</string>
<string>Long</string>
<string>Double</string>
<string>Float</string>
<string>Boolean</string>
<string>Char</string>
<string>Byte</string>
<string>Short</string>
<string>Unit</string>
<string>Any</string>
<string>AnyRef</string>
<string>AnyVal</string>
<string>Nothing</string>
<string>Null</string>
<string>Option</string>
<string>Some</string>
<string>None</string>
<string>List</string>
<string>Array</string>
<string>Map</string>
<string>Set</string>
<string>Seq</string>
<string>Vector</string>
<string>Future</string>
<string>Try</string>
<string>Success</string>
<string>Failure</string>
<string>Either</string>
<string>Left</string>
<string>Right</string>
<string>println</string>
<string>print</string>
<string>require</string>
<string>assert</string>
<string>implicitly</string>
<string>summon</string>
</array>
<!-- Line comment string -->
<key>BBLMCommentLineDefault</key>
<string>// </string>
<!-- Block comment strings -->
<key>BBLMCommentPrefixDefault</key>
<string>/* </string>
<key>BBLMCommentSuffixDefault</key>
<string> */</string>
<!-- Language features -->
<key>Language Features</key>
<dict>
<!-- Character set for identifiers and keywords -->
<key>Identifier and Keyword Character Class</key>
<string>A-Za-z0-9_$</string>
<!-- Line comments -->
<key>Open Line Comments</key>
<string>//</string>
<!-- Block comments -->
<key>Open Block Comments</key>
<string>/*</string>
<key>Close Block Comments</key>
<string>*/</string>
<!-- String literals -->
<key>Open Strings 1</key>
<string>"</string>
<key>Close Strings 1</key>
<string>"</string>
<key>Escape Char in Strings 1</key>
<string>\</string>
<key>End-of-line Ends Strings 1</key>
<true/>
<!-- Character literals -->
<key>Open Strings 2</key>
<string>'</string>
<key>Close Strings 2</key>
<string>'</string>
<key>Escape Char in Strings 2</key>
<string>\</string>
<key>End-of-line Ends Strings 2</key>
<true/>
<!-- Statement blocks -->
<key>Open Statement Blocks</key>
<string>{</string>
<key>Close Statement Blocks</key>
<string>}</string>
<!-- Parameter lists -->
<key>Open Parameter Lists</key>
<string>(</string>
<key>Close Parameter Lists</key>
<string>)</string>
<!-- Function and procedure prefixes -->
<key>Prefix for Functions</key>
<string>def</string>
<key>Prefix for Procedures</key>
<string>def</string>
</dict>
</dict>
</plist>
@bishabosha
Copy link
Author

btw this was just to experiment - it seems BBEdit is super super slow and unusable with its LSP implementation (compared to Zed e.g. which uses the same approach of an explicit executable) so dont expect to be productive.

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