ols icon indicating copy to clipboard operation
ols copied to clipboard

`textDocument/hover` documentation inconsistent with `pkg.odin-lang.org`

Open flysand7 opened this issue 8 months ago • 4 comments

Context

pkg.odin-lang.org does not use Markdown (strictly speaking) to generate documentation for Odin, which causes a lot of the core documentation to be rendered improperly.

Anchored links

For example, the core package adopts a different style for anchored links. The style of the links used by the core library is:

  • [[ https://pkg.odin-lang.org ]]
  • [[ Package documentation; https://pkg.odin-lang.org ]]

To see these links in the core library, check out:

  • core:c/libc/locale.odin:23
  • core:crypto/aegis:6
  • core:encoding/csv:3
Reproduction
package main

import "core:fmt"

/*
[[ Example; https://example.com]]
*/
Test :: struct {
	a: int,
}

main :: proc () {
	a :: Test {}
	//   ^~~^
	//   invoke hover here
}

Bolding sections

pkg.odin-lang.org automatically bolds sections inside the documentation comments.

Image

Image

OLS does not bold these.

Reproduction
package main

import "core:fmt"

/*
Compute sum of two numbers.

Inputs:

- `a`: First number
- `b`: Second number

Returns:
- The sum of the two numbers
*/
sum :: proc(a: int, b: int) -> int {
	return a+b
}

main :: proc () {
	x := sum(2,3)
	//   ^~^
	//   invoke hover here
}

Details

The documentation for the docs website's markup rules can be found in their README.

The implementation for pkg.odin-lang.org markup rules in the source tree.

flysand7 avatar Apr 16 '25 08:04 flysand7