Documentation
¶
Index ¶
- type Config
- type DocumentURI
- type File
- type Package
- type PkgpathURI
- type URI
- type Universe
- func (p *Universe) DidChange(ctx context.Context, params *protocol.DidChangeTextDocumentParams) error
- func (p *Universe) DidChangeConfiguration(ctx context.Context, params *protocol.DidChangeConfigurationParams) error
- func (p *Universe) DidChangeWatchedFiles(ctx context.Context, params *protocol.DidChangeWatchedFilesParams) error
- func (p *Universe) DidChangeWorkspaceFolders(ctx context.Context, params *protocol.DidChangeWorkspaceFoldersParams) error
- func (p *Universe) DidClose(ctx context.Context, params *protocol.DidCloseTextDocumentParams) error
- func (p *Universe) DidCreateFiles(ctx context.Context, params *protocol.CreateFilesParams) error
- func (p *Universe) DidDeleteFiles(ctx context.Context, params *protocol.DeleteFilesParams) error
- func (p *Universe) DidOpen(ctx context.Context, params *protocol.DidOpenTextDocumentParams) error
- func (p *Universe) DidRenameFiles(ctx context.Context, params *protocol.RenameFilesParams) error
- func (p *Universe) DidSave(ctx context.Context, params *protocol.DidSaveTextDocumentParams) error
- func (p *Universe) VFS() fs.FS
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DocumentURI ¶
type DocumentURI = protocol.DocumentURI
type File ¶
type File struct { Version int32 // 版本号 FileUri DocumentURI // 资源路径 PkgPath string // 属于的包路径 Data []byte // file content Mode fs.FileMode // FileInfo.Mode ModTime time.Time // FileInfo.ModTime Sys interface{} // FileInfo.Sys Parsed bool ParsedResult *ast.Node ParsedErr error Saved bool }
文件 可包含当前未保存的编辑内容, 有版本号信息 文件发生变化时重建对应的包和被依赖的包 需要定期检查文件是否被外部修改
type Package ¶
type Package struct { Version int32 // 版本号 UriPath URI // 目录的路径 PkgPath string // 属于的包路径 FileNames []string // 文件名列表 Pkg *types.Package // 类型检查后的包 Info *types.Info // 具名对象信息 Files []*ast.File // 语法树 }
包信息
type PkgpathURI ¶
type PkgpathURI string // import "pkgpath"
type Universe ¶
type Universe struct { Version int32 // 版本号 WaOS string // 系统 WaRoot string // 模块根目录 WorkspaceFolder []URI // 工作区目录 Fset *token.FileSet // Files map[DocumentURI]*File // 工作区文件信息(可能包含被修改的 Std 文件) Pkgs map[PkgpathURI]*Package // 全部包信息(包含 Std) // contains filtered or unexported fields }
模块 每个Wa代码只能属于一个模块 该模块只能依赖 Std, 不会再对其他代码产生依赖
func NewUniverse ¶
func (*Universe) DidChangeConfiguration ¶
func (p *Universe) DidChangeConfiguration(ctx context.Context, params *protocol.DidChangeConfigurationParams) error
配置发生变化
func (*Universe) DidChangeWatchedFiles ¶
func (p *Universe) DidChangeWatchedFiles(ctx context.Context, params *protocol.DidChangeWatchedFilesParams) error
监视的文件列表发生变化
func (*Universe) DidChangeWorkspaceFolders ¶
func (p *Universe) DidChangeWorkspaceFolders(ctx context.Context, params *protocol.DidChangeWorkspaceFoldersParams) error
工作区发生变化
func (*Universe) DidCreateFiles ¶
创建文件
func (*Universe) DidDeleteFiles ¶
删除文件
func (*Universe) DidRenameFiles ¶
重新命名文件
Click to show internal directories.
Click to hide internal directories.