uri

package
v0.0.0-...-df5614f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 2, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddRangeToUri

func AddRangeToUri(u sglsp.DocumentURI, r Range) sglsp.DocumentURI

AddRangeToUri adds a fragment to the URI to allow for exact navigation A range of Start Line 0, Char 1, End Line 1, Char 10 translates to file://..#L1,2-L2,11. This is similar to vscode see e.g. https://github.com/microsoft/vscode/blob/b51955e4c878c8facdd775709740c8aa5d1192d6/src/vs/platform/opener/common/opener.ts#L162

func FolderContains

func FolderContains(folderPath string, path string) bool

func IsDirectory

func IsDirectory(path string) bool

func IsUriDirectory

func IsUriDirectory(documentURI sglsp.DocumentURI) bool

func PathFromUri

func PathFromUri(documentURI sglsp.DocumentURI) string

todo can we create a path domain type? PathFromUri converts the given uri to a file path

func PathToUri

func PathToUri(path string) sglsp.DocumentURI

PathToUri converts a path to a DocumentURI

Types

type Range

type Range struct {
	StartLine int
	EndLine   int
	StartChar int
	EndChar   int
}

Range gives a position in a document. All attributes are 0-based

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL