Documentation
¶
Index ¶
- Variables
- type DocumentService
- func (s *DocumentService) CleanupShadowFiles() error
- func (s *DocumentService) OriginalURI(shadowURI string) (string, bool)
- func (s *DocumentService) PathToURI(path string) string
- func (s *DocumentService) ShadowRoot() string
- func (s *DocumentService) ShadowURI(originalURI string) (string, bool)
- func (s *DocumentService) TransformFinalDoc(text string, sourcePath string) (string, error)
- func (s *DocumentService) TransformShadowDoc(text string, documentURI lsp.DocumentURI) (shadowURI string, err error)
- func (s *DocumentService) URIToPath(uri lsp.DocumentURI) (string, error)
- type DocumentServiceOptions
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultDocumentServiceOptions = DocumentServiceOptions{ ShadowRoot: filepath.Join(os.TempDir(), "litlua-workspace"), ShadowTransformerOpts: transformer.TransformOptions{ WriterMode: litlua.ModeShadow, NoBackup: true, RequirePragmaOutput: false, NoLitLuaOutputExt: false, }, FinalTransformerOpts: transformer.TransformOptions{ WriterMode: litlua.ModePretty, NoBackup: false, RequirePragmaOutput: true, NoLitLuaOutputExt: false, }, }
Functions ¶
This section is empty.
Types ¶
type DocumentService ¶
type DocumentService struct {
// contains filtered or unexported fields
}
DocumentService handles all document transformations and path mappings
func NewDocumentService ¶
func NewDocumentService(opts DocumentServiceOptions) (*DocumentService, error)
func (*DocumentService) CleanupShadowFiles ¶
func (s *DocumentService) CleanupShadowFiles() error
CleanupShadowFiles removes all shadow files
func (*DocumentService) OriginalURI ¶
func (s *DocumentService) OriginalURI(shadowURI string) (string, bool)
OriginalURI returns the original document URI for a shadow file
func (*DocumentService) PathToURI ¶
func (s *DocumentService) PathToURI(path string) string
PathToURI converts a filesystem path to an LSP URI
func (*DocumentService) ShadowRoot ¶
func (s *DocumentService) ShadowRoot() string
ShadowRoot returns the root directory for shadow files
func (*DocumentService) ShadowURI ¶
func (s *DocumentService) ShadowURI(originalURI string) (string, bool)
ShadowURI returns the shadow URI for an original document URI
func (*DocumentService) TransformFinalDoc ¶
func (s *DocumentService) TransformFinalDoc(text string, sourcePath string) (string, error)
TransformFinalDoc transforms a document for final 'compilation' output, returning the absolute path of the output file
func (*DocumentService) TransformShadowDoc ¶
func (s *DocumentService) TransformShadowDoc(text string, documentURI lsp.DocumentURI) (shadowURI string, err error)
TransformShadowDoc transforms the document for LSP proxying and returns the shadow URI
func (*DocumentService) URIToPath ¶
func (s *DocumentService) URIToPath(uri lsp.DocumentURI) (string, error)
URIToPath converts an LSP URI to a filesystem path
type DocumentServiceOptions ¶
type DocumentServiceOptions struct {
ShadowTransformerOpts transformer.TransformOptions
FinalTransformerOpts transformer.TransformOptions
// Root directory for shadow files
ShadowRoot string
}
func (DocumentServiceOptions) Validate ¶
func (o DocumentServiceOptions) Validate() error
Click to show internal directories.
Click to hide internal directories.