Documentation
¶
Overview ¶
Package comment holds the comment tokens of the languages (SPEC §8.6.5): what the commands that comment and uncomment lines need to know of a language. It has no text and no cursors; the editing functions of internal/core/edit use it.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Language ¶
type Language struct {
// Line starts a comment that ends with the line; empty for none.
Line string
// NoIndent puts a line comment at the first column and not at the indentation of the line.
NoIndent bool
// BlockStart and BlockEnd begin and end a block comment; both are empty for none.
BlockStart, BlockEnd string
}
Language is how the comments of one language are written. It is read-only once made, so it can be shared.
func NewLanguage ¶
func NewLanguage(c *language.Configuration) *Language
NewLanguage makes the Language of a language configuration, which may be nil.
Ported from VS Code: src/vs/editor/common/languages/languageConfigurationRegistry.ts (_handleComments)
type Languages ¶
Languages gives the Language for the code of a language of the document or of one embedded in it. It must never return nil.
type RegistryLanguages ¶
type RegistryLanguages struct {
// contains filtered or unexported fields
}
RegistryLanguages gives the Languages of a language registry. It makes each once.
func NewRegistryLanguages ¶
func NewRegistryLanguages(reg *language.Registry) *RegistryLanguages
NewRegistryLanguages makes the Languages of a registry. When the configurations of the registry change, make a new one.
func (*RegistryLanguages) Language ¶
func (r *RegistryLanguages) Language(code int) *Language
Language implements Languages.