Skip to content

Commit a3c9f26

Browse files
committed
Fixes validation bug and adds contrib section to readme
1 parent 3d84625 commit a3c9f26

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ When the language server and extension are used together and configured to load
1515
- Creating new Markdoc files from user-defined templates via the new file menu
1616
- Linked editing for matched opening and closing tag names
1717

18-
## Configuration quickstart
18+
# Configuration quickstart
1919

2020
After installing the Markdoc extension in Visual Studio Code, create a Markdoc language server configuration file. The extension looks for a file called `markdoc.config.json` in your workspace root, but you can customize this in the extension's settings.
2121

@@ -55,6 +55,10 @@ It is possible to have multiple Markdoc configurations for the same workspace by
5555

5656
In [multi-root workspaces](https://code.visualstudio.com/docs/editor/multi-root-workspaces), a Markdoc configuration file is specific to an individual workspace root. You can have separate Markdoc configuration files for each root. If you need to override the location of the Markdoc language server configuration file in a multi-root workspace, you can use a [folder setting](https://code.visualstudio.com/docs/editor/multi-root-workspaces#_settings) to customize this behavior per root.
5757

58+
# Contributing
59+
60+
Contributions and feedback are welcomed and encouraged. Feel free to open PRs here, or open issues and discussion threads in the [Markdoc core repo](https://github.com/markdoc/markdoc).
61+
5862
## Building from source
5963

6064
```
@@ -73,6 +77,6 @@ The test suite relies on the 'node:test' module that is only included in Node.js
7377
$ npm run test
7478
```
7579

76-
## License
80+
# License
7781

7882
This project uses the [MIT license](LICENSE).

server/plugins/validation.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ export default class ValidationProvider {
4343
};
4444
}
4545

46-
createRange(line: number, location?: Markdoc.Location): LSP.Range {
46+
createRange(line: number = 0, location?: Markdoc.Location): LSP.Range {
4747
const { start, end } = location ?? {};
48-
if (start?.character && end?.character)
48+
if (start?.character !== undefined && end?.character !== undefined)
4949
return LSP.Range.create(
5050
start.line,
5151
start.character,

0 commit comments

Comments
 (0)