Skip to content

Commit

Permalink
Fixes validation bug and adds contrib section to readme
Browse files Browse the repository at this point in the history
  • Loading branch information
rpaul-stripe committed May 31, 2023
1 parent 3d84625 commit a3c9f26
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ When the language server and extension are used together and configured to load
- Creating new Markdoc files from user-defined templates via the new file menu
- Linked editing for matched opening and closing tag names

## Configuration quickstart
# Configuration quickstart

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.

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

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.

# Contributing

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).

## Building from source

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

## License
# License

This project uses the [MIT license](LICENSE).
4 changes: 2 additions & 2 deletions server/plugins/validation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ export default class ValidationProvider {
};
}

createRange(line: number, location?: Markdoc.Location): LSP.Range {
createRange(line: number = 0, location?: Markdoc.Location): LSP.Range {
const { start, end } = location ?? {};
if (start?.character && end?.character)
if (start?.character !== undefined && end?.character !== undefined)
return LSP.Range.create(
start.line,
start.character,
Expand Down

0 comments on commit a3c9f26

Please sign in to comment.