Comments (14)
No, again this is where an LSP/active extension comes in.
from myst-vs-code.
I'd be happy to if I knew how??
From a quick google, and when I've looked at other extensions, I don't see any specific option to add to the package, to say that insiders is supported.
You'd have to look into this
from myst-vs-code.
ok cool, I'll just try moving to stable then π
from myst-vs-code.
yeh definitely go for it. I ironed out a few kinks and now itβs working really well for me
from myst-vs-code.
awesome! vs code stable has it working!
is there something else we should install to get syntax completion (either in code blocks, or for things like sphinx) working? I see markdown highlighting is working great, but don't seem to be getting autocompletion
(note, intellisense does seem to work for python files)
from myst-vs-code.
This is only a static syntax highlighter at present, i.e. in doesn't do any active analysis on the file in the way an LSP does (above what VS Code or any extensions you have installed are already doing for markdown files). So when e.g. it reaches a python code cell, it will set the 'scope' to be python; which hooks in some limited features, e.g. syntax highlghting, correct commenting format (when you press CMD+/) and snippet completion (try pressing CTRL+Space):
and as it says now in the README, I have also added a few directive snippets:
Note, you can see the language scope you are in using the Developer: Inspect TM Scopes
command, which is super helpful for developing/checking the highlight grammar:
For proper syntax completion etc, this is where an LSP comes in; to be actively compiling a database of syntax elements, by source text ranges, mapping that to the current cursor position (supplied by the client), and reporting back to the client with data such as autocompletion lists.
from myst-vs-code.
ah ok, I figured it out - I was overriding the keyboard shortcut to bring up intellisense, and now I have discovered a whole new feature of vscode lol.
Being able to quickly get a list of directives to insert is awesome
from myst-vs-code.
Being able to quickly get a list of directives to insert is awesome
Absolutely, it's a nice quick win, as opposed to potentially/hopefully writing a more feature rich LSP somewhere down the line.
As a user you can add your own custom snippets (see the VS Code docs), or the ones packaged with the extension are implemented with this template/build file: https://github.com/ExecutableBookProject/myst-highlight-grammar/tree/master/snippets
So if you wanted to add additional ones here, feel free to make a PR π
from myst-vs-code.
To check that I am correct, if I wanted to add, say, a glue directive, it would look like this:
"directive-glue": {
"description": "a glue directive",
"prefix": [
"directive-glue"
],
"body": [
"```{glue:${1:directive}} ${0:key}",
"```",
""
]
}
and if I wanted to add a role, it would look something like this?
"role-glue": {
"description": "a glue role",
"prefix": [
"role-glue"
],
"body": [
"{glue}`${0:key}`",
]
}
Also - looking at the docs, why do we have the first $1
at the end of the triple backticks?
from myst-vs-code.
π
Also - looking at the docs, why do we have the first $1 at the end of the triple backticks?
The idea was that you can quickly modify the 'nesting depth' of your directives: press enter on the snippet, press `
, then press tab, and you now have a directive enclosed by 4 backticks instead of 3.
Its an open question if this is a help or a hindrance
from myst-vs-code.
ah ha - I hadn't thought about that use-case...but it makes sense to me! I'm sure I would have run across this when I was doing more docs work with this plugin
from myst-vs-code.
Yeh just keep using it and report back any bugs!
This was a particular gotcha with this new injection approach ccff426, whereby it was incorrectly injecting into things like math and code blocks, but hopefully this is fixed.
from myst-vs-code.
and there might be fine-tuning to the name scope for each element is assigned (which affects e.g.what color it is assigned)
from myst-vs-code.
makes sense π
are there ways to define "sub-commands" in the schema? e.g. if we wanted to say "if someone chooses the glue directive, then give them the option of :figure
, :text
, etc? or would each of those need to be separate entries in the schema?
from myst-vs-code.
Related Issues (20)
- Add Code Execution capability for MyST HOT 4
- VSCode Markdown Preview Enhancement: MyST enhancements are not rendering as expected HOT 13
- Refresh package HOT 1
- User reports of Issues using Extension on Linux platform
- Can't find the extension in the marketplace HOT 3
- Inline roles in tables break markdown preview HOT 1
- Unpin testing from VS Code 1.47.0
- MyST-Markdown rendering in notebooks (awaiting API release) HOT 6
- submit the extension to open-vsx.org HOT 4
- Allow for use as a web extension
- Update myst-target and myst-role plugins
- Rendering of sphinx extensions HOT 2
- autocomplete references HOT 2
- Add more directives HOT 3
- Add to OpenVSX marketplace HOT 2
- Myst-vs-code blocks plantuml rendering for code blocks HOT 1
- Math directive does not render in preview HOT 1
- Add syntax highlighting for directives specified using the colon fence HOT 3
- Preview for code-block directive HOT 1
- Markdown Preview is not correctly rendering HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from myst-vs-code.