# Suppose you are at path xxx
mkdir tmp
cp ~/Library/Application\ Support/Sublime\ Text/Installed\ Packages/LSP-typescript.sublime-package .
cd tmp # now at: xxx/tmp
unzip ../LSP-typescript.sublime-package # extracts to the current dir
cd typescript-language-server # now at: xxx/tmp/typescript-language-server
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { blockFunctionNameSet } from './names' | |
interface InputConfig { | |
debug?: boolean | |
locations?: boolean | |
allowServiceRules?: boolean | |
} | |
type IVLanguageVersion = '1.0' | '2.0' | '2.1' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { | |
StateField, | |
StateEffect, | |
EditorSelection, | |
StateEffectType, | |
} from '@codemirror/state' | |
import { EditorView, ViewPlugin } from '@codemirror/view' | |
/** @import { Text, Line } from '@codemirror/state' */ | |
/** @import { PluginValue, BlockInfo } from '@codemirror/view' */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { minimalSetup } from 'codemirror' | |
import { EditorState } from '@codemirror/state' | |
import { EditorView, keymap } from '@codemirror/view' | |
import { insertNewlineAndIndent, insertBlankLine } from '@codemirror/commands' | |
function removeNewlineCommands(exts) { | |
const newlineCommands = [insertNewlineAndIndent, insertBlankLine] | |
return exts.map(ext => { | |
if (ext?.facet == keymap) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { basicSetup, minimalSetup } from 'codemirror' | |
import { Prec } from '@codemirror/state' | |
import { EditorView, keymap, placeholder } from '@codemirror/view' | |
import { search, findNext, findPrevious } from '@codemirror/search' | |
const SearchPanel = (() => { | |
const searchConfigFacet = search({})[0].facet |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@top JSONDiff { section* } | |
value { True | False | Null | Number | String | Object | Array } | |
section { | |
Header | |
(Deletion+ Insertion* | Insertion+) | |
} | |
Header { "@" "[" list<path> "]" "\n" } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {basicSetup} from 'codemirror' | |
import { | |
autocompletion, | |
completionStatus, | |
setSelectedCompletion, | |
currentCompletions, | |
selectedCompletionIndex, | |
moveCompletionSelection, | |
closeBrackets, | |
} from '@codemirror/autocomplete' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
// These settings override both User and Default settings for the JavaScript syntax | |
{ | |
"auto_complete_selector": "meta.tag, comment.block.documentation, source - comment - string.quoted.double.block - string.quoted.single.block - string.unquoted.heredoc", | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { foldService } from '@codemirror/language' | |
/** @param {string} text */ | |
function indentLevel(text) { | |
const mat = /** @type {RegExpMatchArray} */ ( | |
text.match(/^( *)([^ ]?)/)) | |
return mat[2] ? mat[1].length : -1 | |
} | |
export const foldByIndentation = foldService.of(({ doc }, from, _to) => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { EditorState, Text } from '@codemirror/state' | |
import { changeTracker, lineStatistics, commit } from './lib/codemirror/experiments.js' | |
/** @typedef {{ len: number, count: number }} LineStat */ | |
function countSurrogates(/** @type {string} */ s) { | |
const regex = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g | |
let n = 0 | |
while (regex.exec(s)) n++ | |
return n |
NewerOlder