profile
viewpoint
Sean K Smith sksmith Dick's Sporting Goods Pittsburgh, PA http://seanksmith.me Java developer at work, Go developer for fun!

ironpencil/replayjam2018 1

ReplayFX Game Jam 2018

ironpencil/underbaked 1

Game jam repos

sksmith/lifegl 1

Conway's Game of Life using opengl and go

ironpencil/replayjam 0

Replay Jam

ironpencil/suddendeath 0

Sudden Death Jam

sksmith/blog 0

a markdown blog

sksmith/blog-server 0

A markdown blog server

sksmith/bunnyq 0

A retrying multi-threaded rabbitmq client

sksmith/cli-table 0

A simple utility for CLI tools to create tables

sksmith/cp-docker-images 0

Docker images for Confluent Platform.

startedholgerbrandl/kscript

started time in 3 days

startedokta/okta-cli

started time in 6 days

startedekiojp/dfex

started time in 20 days

startedekiojp/circo

started time in 20 days

MemberEvent
MemberEvent

fork icza/goftp

Golang FTP library with Walk support.

fork in a month

startedtsuyo/java-native-cli-graalvm-picocli

started time in a month

startedhegerdes/PicoCLIsetup

started time in 2 months

startedmsys2/msys2.github.io

started time in 2 months

issue openedPlusHaze/TrayNotification

main screen disappears in full screen

When the application is in full screen mode, TrayNotification appears, but the .

created time in 2 months

startednetenglabs/suzieq

started time in 2 months

issue commentfoambubble/foam

If the title contains special characters, link references do not work as expected

I started looking into updating to use github-slugger in Markdown Notes, and I was originally thinking that I might make it the new default, but given how much breaks, I think it probably does not make sense to default to it:

https://github.com/kortina/vscode-markdown-notes/pull/85/files

hezhizhen

comment created time in 3 months

PR opened foambubble/foam

Added link to migrating from Bear

I don't have anything yet for this but I think I'll need it at some point and I think it'll be good to bring people on ideas.

+1 -0

0 comment

1 changed file

pr created time in 3 months

delete branch foambubble/foam

delete branch : lsp-boilerplate

delete time in 3 months

push eventfoambubble/foam

Jani Eväkallio

commit sha b0051b4da361668c6a35de635dc6cbed5010d086

Setup Language Server boilerplate (#258)

view details

push time in 3 months

PR merged foambubble/foam

Setup Language Server boilerplate foam-language-server

This is the initial PR to start work on a Foam Markdown Language Server.

Note that this PR targets long-lived feature/lsp branch and not master. This branch will act as a staging area until the infrastructure changes are stable and we've verified that it won't break any existing functionality, at which point it'll be landed to master and shipped behind a feature flag.

Significant changes

This PR sets up the basic infrastructure to begin developing and debugging LSP Server and Client within the Foam monorepo, namely:

It's probably easiest to review this commit-by-commit. It's not very large.

Functionality

Functionally, this PR doesn't do anything interesting. It sets up an autocompletion for words "Foam", "Roam", and "Obsidian" that are triggered by a [ character:

functionality

+337 -7

0 comment

12 changed files

jevakallio

pr closed time in 3 months

issue commentfoambubble/foam

Render workspace using VuePress with built-in media-wiki links rendering, backlinks and more...

In one word: impressive!

Please keep us posted

p.s. love the final quote from your repo, and I totally agree 😁

spencerwooo

comment created time in 3 months

issue openedfoambubble/foam

Render workspace using VuePress with built-in media-wiki links rendering, backlinks and more...

I spent the past 3 days or so tinkering with Foam and what-not, and I'd like to share my current progress: https://wiki.spencerwoo.com/.

Some of the features that may interest you:

  • Built with VuePress and rendered into a lightweight, ultra-fast, SPA website. I like this solution far more than Jekyll for what it's worth. Most of my own project's documentation website is powered by VuePress.

  • Built-in [[media-wiki]] style link rendering (into Vue Router links), which is supported by a separate plugin I customised: spencerwooo/vuepress-markdown-it-wikilink. This means that VuePress can render [[media-wiki]] links regardless of Foam's hacky workaround by using Markdown link references (but these two play well together still). This also provides a way to render Obsidian workspaces (considering they don't auto-generate link references like Foam).

  • Makes foam-cli and note-link-janitor play well together. Because Foam auto-generates link references at the end of the document, so I modified andymatuschak/note-link-janitor a little bit (no, like a lot actually) and made it so that note-link-janitor renders the backlinks section in between the end of the article and the start of Foam's link references. This generates a nice little section of backlink references at the bottom of each page:

    image

  • And of course there's LaTeX rendering support!!! (which is also made possible with a custom version of vuepress/vuepress-plugin-mathjax because their current version breaks on rendering aligned environments.)

  • Finally, I also wrote a new custom VuePress theme to render my Foam workspace in a style quite similiar to the default Jekyll theme.

There's definitely room for improvements:

  • foam-cli and note-link-janitor needs to be run manually on each redeployment. We can absolutely use pre-commit hooks to automate this, but in the mean time, VuePress is capable of generating both the backlinks section that note-link-janitor renders and the [[media-wiki]] style links foam-cli renders, so this is definitely a thing I could work on in the future.
  • VuePress is also definitely capable of generating a graph of local links all on its own, so this is another feature I'm trying to implement.
  • Getting rid of the default VuePress search bar may not be the best idea. (But it's easily re-implementable. ㄟ( ▔, ▔ )ㄏ) I saw some folks wishing for a simple search functionality and to be fair any static site generator should already have such plugins.
  • This certainly goes against Foam's as little code as possible concept, but hey, I heard Foam is trying to migrate to Gatsby as well. 😏
  • ...

Phew, that's a lot of things to cover. I really like to create something like a VuePress Foam template and in the meantime contribute another recipe(s), but I'm not going to have time to work on this for the next couple of days or weeks 😥. Anyway, I thought people might be interested in what I have done so far, so here's my repo for the code I used to implement this: spencerwooo/foam-wiki.

(PS: I didn't republish my custom version of the plugins mathjax-plugin, note-link-janitor and the custom VuePress theme, because they are quite task-specific and also quite unpolished.)

created time in 3 months

issue commentfoambubble/foam

Search for hosted Foam?

@jetk A published Foam workspace is simply a Jekyll generated static website, so I'd assume this would work: christian-fei/Simple-Jekyll-Search.

jetk

comment created time in 3 months

issue commentfoambubble/foam

If the title contains special characters, link references do not work as expected

I also create my files via inline [[wiki-links]], so would love a solution to using special characters (at the very "normal" punctuation like -,?!) in file names. Currently, I am just removing all punctuation other than hyphens from titles/filenames when I create them.

I don't know how this affects markdown/html though...

hezhizhen

comment created time in 3 months

Pull request review commentfoambubble/foam

Setup Language Server boilerplate

+import * as path from "path";+import { workspace, ExtensionContext } from "vscode";+import { FoamFeature } from "../../types";++import {+  LanguageClient,+  LanguageClientOptions,+  ServerOptions,+  TransportKind+} from "vscode-languageclient";++let client: LanguageClient;++const feature: FoamFeature = {+  activate: (context: ExtensionContext) => {+    // @TODO figure out path for production deploys+    let serverModule = context.asAbsolutePath(+      path.join("..", "foam-language-server", "dist", "index.js")+    );++    // The debug options for the server+    // --inspect=6009: runs the server in Node's Inspector mode so VS Code can attach to the server for debugging+    let debugOptions = { execArgv: ["--nolazy", "--inspect=6009"] };++    // If the extension is launched in debug mode then the debug server options are used+    // Otherwise the run options are used+    let serverOptions: ServerOptions = {+      run: { module: serverModule, transport: TransportKind.ipc },+      debug: {+        module: serverModule,+        transport: TransportKind.ipc,+        options: debugOptions+      }+    };++    // Options to control the language client+    let clientOptions: LanguageClientOptions = {+      // Register the server for plain markdown documents+      documentSelector: [+        { scheme: "file", language: "markdown" },+        { scheme: "file", language: "mdx" }+      ],+      synchronize: {+        fileEvents: workspace.createFileSystemWatcher(+          "**/.vscode/settings.json"

This only watches the settings file for settings synchronisation.

LSP has a direct mechanism for giving updates to changed files in open buffers that doesn't require an explicit watcher. I'm not sure how we'll monitor background changes yet.

jevakallio

comment created time in 3 months

Pull request review commentfoambubble/foam

Setup Language Server boilerplate

+import * as path from "path";+import { workspace, ExtensionContext } from "vscode";+import { FoamFeature } from "../../types";++import {+  LanguageClient,+  LanguageClientOptions,+  ServerOptions,+  TransportKind+} from "vscode-languageclient";++let client: LanguageClient;++const feature: FoamFeature = {+  activate: (context: ExtensionContext) => {+    // @TODO figure out path for production deploys+    let serverModule = context.asAbsolutePath(+      path.join("..", "foam-language-server", "dist", "index.js")+    );++    // The debug options for the server+    // --inspect=6009: runs the server in Node's Inspector mode so VS Code can attach to the server for debugging+    let debugOptions = { execArgv: ["--nolazy", "--inspect=6009"] };++    // If the extension is launched in debug mode then the debug server options are used

It's inherited from the lsp-sample package, but I believe so. Any reason to think it's not?

jevakallio

comment created time in 3 months

Pull request review commentfoambubble/foam

Setup Language Server boilerplate

+import {+	createConnection,+	ProposedFeatures,+	InitializeParams,+	DidChangeConfigurationNotification,+	CompletionItem,+	CompletionItemKind,+	TextDocumentPositionParams,+	TextDocumentSyncKind,+	InitializeResult+} from 'vscode-languageserver';++const data = [+	{+		text: 'Foam',+		displayName: 'Foam',+		description: 'Foam is a personal knowledge management and sharing system built on Visual Studio Code and GitHub.'+	},+	{+		text: 'Roam',+		displayName: 'Roam Research',+		description: 'Roam is a A note-taking tool for networked thought',+	},+	{+		text: 'Obsidian',+		displayName: "Obsidian",+		description: 'Obsidian is a powerful knowledge base that works on top of a local folder of plain text Markdown files.'+	}+];++// Create a connection for the server, using Node's IPC as a transport.+// Also include all preview / proposed LSP features.+let connection = createConnection(ProposedFeatures.all);++let hasConfigurationCapability: boolean = false;+let hasWorkspaceFolderCapability: boolean = false;++connection.onInitialize((params: InitializeParams) => {+	let capabilities = params.capabilities;++	// Does the client support the `workspace/configuration` request?+	// If not, we fall back using global settings.+	hasConfigurationCapability = !!(+		capabilities.workspace && !!capabilities.workspace.configuration+    );+    +	hasWorkspaceFolderCapability = !!(+		capabilities.workspace && !!capabilities.workspace.workspaceFolders+    );++	const result: InitializeResult = {+		capabilities: {+			textDocumentSync: TextDocumentSyncKind.Incremental,+			// Tell the client that this server supports code completion.+			completionProvider: {+				triggerCharacters: ["["],

This only supports single characters. We won't be using the triggerCharacters in the actual implementation, but instead we can use the positional info provided to the completion handler.

This implementation here is just a simple way of testing this functionality.

jevakallio

comment created time in 3 months

Pull request review commentfoambubble/foam

Setup Language Server boilerplate

+import * as path from "path";+import { workspace, ExtensionContext } from "vscode";+import { FoamFeature } from "../../types";++import {+  LanguageClient,+  LanguageClientOptions,+  ServerOptions,+  TransportKind+} from "vscode-languageclient";++let client: LanguageClient;++const feature: FoamFeature = {+  activate: (context: ExtensionContext) => {+    // @TODO figure out path for production deploys+    let serverModule = context.asAbsolutePath(+      path.join("..", "foam-language-server", "dist", "index.js")+    );++    // The debug options for the server+    // --inspect=6009: runs the server in Node's Inspector mode so VS Code can attach to the server for debugging+    let debugOptions = { execArgv: ["--nolazy", "--inspect=6009"] };++    // If the extension is launched in debug mode then the debug server options are used+    // Otherwise the run options are used+    let serverOptions: ServerOptions = {+      run: { module: serverModule, transport: TransportKind.ipc },+      debug: {+        module: serverModule,+        transport: TransportKind.ipc,+        options: debugOptions+      }+    };++    // Options to control the language client+    let clientOptions: LanguageClientOptions = {+      // Register the server for plain markdown documents+      documentSelector: [+        { scheme: "file", language: "markdown" },+        { scheme: "file", language: "mdx" }+      ],+      synchronize: {+        fileEvents: workspace.createFileSystemWatcher(+          "**/.vscode/settings.json"

is this enough? would it also catch e.g. files being renamed/moved?

jevakallio

comment created time in 3 months

Pull request review commentfoambubble/foam

Setup Language Server boilerplate

+import * as path from "path";+import { workspace, ExtensionContext } from "vscode";+import { FoamFeature } from "../../types";++import {+  LanguageClient,+  LanguageClientOptions,+  ServerOptions,+  TransportKind+} from "vscode-languageclient";++let client: LanguageClient;++const feature: FoamFeature = {+  activate: (context: ExtensionContext) => {+    // @TODO figure out path for production deploys+    let serverModule = context.asAbsolutePath(+      path.join("..", "foam-language-server", "dist", "index.js")+    );++    // The debug options for the server+    // --inspect=6009: runs the server in Node's Inspector mode so VS Code can attach to the server for debugging+    let debugOptions = { execArgv: ["--nolazy", "--inspect=6009"] };++    // If the extension is launched in debug mode then the debug server options are used

is this comment accurate?

jevakallio

comment created time in 3 months

Pull request review commentfoambubble/foam

Setup Language Server boilerplate

+import {+	createConnection,+	ProposedFeatures,+	InitializeParams,+	DidChangeConfigurationNotification,+	CompletionItem,+	CompletionItemKind,+	TextDocumentPositionParams,+	TextDocumentSyncKind,+	InitializeResult+} from 'vscode-languageserver';++const data = [+	{+		text: 'Foam',+		displayName: 'Foam',+		description: 'Foam is a personal knowledge management and sharing system built on Visual Studio Code and GitHub.'+	},+	{+		text: 'Roam',+		displayName: 'Roam Research',+		description: 'Roam is a A note-taking tool for networked thought',+	},+	{+		text: 'Obsidian',+		displayName: "Obsidian",+		description: 'Obsidian is a powerful knowledge base that works on top of a local folder of plain text Markdown files.'+	}+];++// Create a connection for the server, using Node's IPC as a transport.+// Also include all preview / proposed LSP features.+let connection = createConnection(ProposedFeatures.all);++let hasConfigurationCapability: boolean = false;+let hasWorkspaceFolderCapability: boolean = false;++connection.onInitialize((params: InitializeParams) => {+	let capabilities = params.capabilities;++	// Does the client support the `workspace/configuration` request?+	// If not, we fall back using global settings.+	hasConfigurationCapability = !!(+		capabilities.workspace && !!capabilities.workspace.configuration+    );+    +	hasWorkspaceFolderCapability = !!(+		capabilities.workspace && !!capabilities.workspace.workspaceFolders+    );++	const result: InitializeResult = {+		capabilities: {+			textDocumentSync: TextDocumentSyncKind.Incremental,+			// Tell the client that this server supports code completion.+			completionProvider: {+				triggerCharacters: ["["],+				resolveProvider: true+			}+		}+    };+    +	if (hasWorkspaceFolderCapability) {+		result.capabilities.workspace = {+			workspaceFolders: {+				supported: true+			}+		};+	}+	return result;+});++connection.onInitialized(() => {+	if (hasConfigurationCapability) {+		// Register for all configuration changes.+		connection.client.register(DidChangeConfigurationNotification.type, undefined);+	}+	if (hasWorkspaceFolderCapability) {+		connection.workspace.onDidChangeWorkspaceFolders(_event => {+			connection.console.log('Workspace folder change event received.');+		});+	}+});++connection.onDidChangeConfiguration(change => {+	if (hasConfigurationCapability) {++	}+});++connection.onDidChangeWatchedFiles(_change => {+	// Monitored files have change in VSCode+	connection.console.log('We received an file change event');+});++// This handler provides the initial list of the completion items.+connection.onCompletion(+	(_textDocumentPosition: TextDocumentPositionParams): CompletionItem[] => {+		console.log('onCompletion.textDocumentPosition', _textDocumentPosition);+		// The pass parameter contains the position of the text document in+		// which code complete got requested. For the example we ignore this+		// info and always provide the same completion items.+		return data.map(item => ({+			label: item.displayName,+			kind: CompletionItemKind.Text,+			data: item.text+		}));+	}+);++// This handler resolves additional information for the item selected in+// the completion list.+connection.onCompletionResolve(

oh nice, this is going to be handy

jevakallio

comment created time in 3 months

Pull request review commentfoambubble/foam

Setup Language Server boilerplate

+import {+	createConnection,+	ProposedFeatures,+	InitializeParams,+	DidChangeConfigurationNotification,+	CompletionItem,+	CompletionItemKind,+	TextDocumentPositionParams,+	TextDocumentSyncKind,+	InitializeResult+} from 'vscode-languageserver';++const data = [+	{+		text: 'Foam',+		displayName: 'Foam',+		description: 'Foam is a personal knowledge management and sharing system built on Visual Studio Code and GitHub.'+	},+	{+		text: 'Roam',+		displayName: 'Roam Research',+		description: 'Roam is a A note-taking tool for networked thought',+	},+	{+		text: 'Obsidian',+		displayName: "Obsidian",+		description: 'Obsidian is a powerful knowledge base that works on top of a local folder of plain text Markdown files.'+	}+];++// Create a connection for the server, using Node's IPC as a transport.+// Also include all preview / proposed LSP features.+let connection = createConnection(ProposedFeatures.all);++let hasConfigurationCapability: boolean = false;+let hasWorkspaceFolderCapability: boolean = false;++connection.onInitialize((params: InitializeParams) => {+	let capabilities = params.capabilities;++	// Does the client support the `workspace/configuration` request?+	// If not, we fall back using global settings.+	hasConfigurationCapability = !!(+		capabilities.workspace && !!capabilities.workspace.configuration+    );+    +	hasWorkspaceFolderCapability = !!(+		capabilities.workspace && !!capabilities.workspace.workspaceFolders+    );++	const result: InitializeResult = {+		capabilities: {+			textDocumentSync: TextDocumentSyncKind.Incremental,+			// Tell the client that this server supports code completion.+			completionProvider: {+				triggerCharacters: ["["],

shouldn't this be double square bracket? or does it has for single characters?

jevakallio

comment created time in 3 months

Pull request review commentfoambubble/foam

Setup Language Server boilerplate

+import {+	createConnection,+	ProposedFeatures,+	InitializeParams,+	DidChangeConfigurationNotification,+	CompletionItem,+	CompletionItemKind,+	TextDocumentPositionParams,+	TextDocumentSyncKind,+	InitializeResult+} from 'vscode-languageserver';++const data = [+	{+		text: 'Foam',+		displayName: 'Foam',+		description: 'Foam is a personal knowledge management and sharing system built on Visual Studio Code and GitHub.'+	},+	{+		text: 'Roam',+		displayName: 'Roam Research',+		description: 'Roam is a A note-taking tool for networked thought',+	},+	{+		text: 'Obsidian',+		displayName: "Obsidian",+		description: 'Obsidian is a powerful knowledge base that works on top of a local folder of plain text Markdown files.'+	}+];++// Create a connection for the server, using Node's IPC as a transport.+// Also include all preview / proposed LSP features.+let connection = createConnection(ProposedFeatures.all);++let hasConfigurationCapability: boolean = false;+let hasWorkspaceFolderCapability: boolean = false;++connection.onInitialize((params: InitializeParams) => {+	let capabilities = params.capabilities;++	// Does the client support the `workspace/configuration` request?+	// If not, we fall back using global settings.+	hasConfigurationCapability = !!(+		capabilities.workspace && !!capabilities.workspace.configuration+    );+    +	hasWorkspaceFolderCapability = !!(+		capabilities.workspace && !!capabilities.workspace.workspaceFolders+    );++	const result: InitializeResult = {+		capabilities: {+			textDocumentSync: TextDocumentSyncKind.Incremental,+			// Tell the client that this server supports code completion.+			completionProvider: {+				triggerCharacters: ["["],+				resolveProvider: true+			}+		}+    };+    +	if (hasWorkspaceFolderCapability) {+		result.capabilities.workspace = {+			workspaceFolders: {+				supported: true+			}+		};+	}+	return result;+});++connection.onInitialized(() => {+	if (hasConfigurationCapability) {+		// Register for all configuration changes.+		connection.client.register(DidChangeConfigurationNotification.type, undefined);+	}+	if (hasWorkspaceFolderCapability) {+		connection.workspace.onDidChangeWorkspaceFolders(_event => {+			connection.console.log('Workspace folder change event received.');+		});+	}+});++connection.onDidChangeConfiguration(change => {+	if (hasConfigurationCapability) {+

To be implemented. This is boilerplate from lsp-sample, which we'll need once we implement config management.

jevakallio

comment created time in 3 months

more