# 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 hidden or 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
// ==UserScript== | |
// @name yorkxin | |
// @version 1 | |
// @match https://blog.yorkxin.org/* | |
// @grant none | |
// ==/UserScript== | |
const links = Array.from(document.querySelectorAll('a[href]')) | |
let cnt = 0 |
This file contains hidden or 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 type { GreaterThanOrEqual, Merge } from 'type-fest' | |
import { BuildTuple, Whitespace } from 'type-fest/source/internal' | |
// TODO: trim comments | |
type TrimWS<S extends string> = | |
S extends `${Whitespace}${infer R}` ? ( | |
R extends `${Whitespace}${infer RR}` ? ( | |
RR extends `${Whitespace}${infer RRR}` ? ( | |
RRR extends `${Whitespace}${infer RRRR}` ? TrimWS<RRRR> : RRR | |
) : RR) : R) : S |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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", | |
} |
NewerOlder