# LanguageService

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-designer-language/struct-languageservice/

**struct** · [`ferroui-designer-language`](/docs/0.5.0/api/ferroui-designer-language/) · v0.5.0

```rust
struct LanguageService
```



[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Designer.Language/service.rs#L116)

## Members

- [`new`](#function-new)
- [`schema`](#function-schema)
- [`schema_mut`](#function-schema_mut)
- [`document`](#function-document)
- [`version`](#function-version)
- [`index`](#function-index)
- [`uris`](#function-uris)
- [`open`](#function-open)
- [`close`](#function-close)
- [`replace`](#function-replace)
- [`change`](#function-change)
- [`index_solution`](#function-index_solution)
- [`remove_solution`](#function-remove_solution)
- [`diagnostics`](#function-diagnostics)
- [`completions`](#function-completions)
- [`hover`](#function-hover)
- [`signature_help`](#function-signature_help)
- [`definitions`](#function-definitions)
- [`references`](#function-references)
- [`references_with_declarations`](#function-references_with_declarations)
- [`rename`](#function-rename)
- [`apply_workspace_edit`](#function-apply_workspace_edit)
- [`format`](#function-format)
- [`symbols`](#function-symbols)
- [`folding`](#function-folding)
- [`semantic_tokens`](#function-semantic_tokens)
- [`workspace_symbols`](#function-workspace_symbols)
- [`resource_uri`](#function-resource_uri)
- [`prepare_rename`](#function-prepare_rename)
- [`mark_saved`](#function-mark_saved)
- [`rename_uri`](#function-rename_uri)
- [`rename_uris`](#function-rename_uris)
- [`file_rename_edits`](#function-file_rename_edits)

<a id="function-new"></a>

### new

```rust
fn new(schema: Schema) -> Self
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Designer.Language/service.rs#L185)

<a id="function-schema"></a>

### schema

```rust
fn schema(self: &Self) -> &Schema
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Designer.Language/service.rs#L193)

<a id="function-schema_mut"></a>

### schema_mut

```rust
fn schema_mut(self: &mut Self) -> &mut Schema
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Designer.Language/service.rs#L196)

<a id="function-document"></a>

### document

```rust
fn document(self: &Self, uri: &str) -> Option<&Document>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Designer.Language/service.rs#L199)

<a id="function-version"></a>

### version

```rust
fn version(self: &Self, uri: &str) -> Option<i64>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Designer.Language/service.rs#L202)

<a id="function-index"></a>

### index

```rust
fn index(self: &Self, uri: &str) -> Result<&LineIndex>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Designer.Language/service.rs#L205)

<a id="function-uris"></a>

### uris

```rust
fn uris(self: &Self) -> impl Iterator<Item = &str>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Designer.Language/service.rs#L208)

<a id="function-open"></a>

### open

```rust
fn open(self: &mut Self, uri: impl Into<String>, source: impl Into<String>, version: i64) -> Result<()>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Designer.Language/service.rs#L211)

<a id="function-close"></a>

### close

```rust
fn close(self: &mut Self, uri: &str) -> Result<()>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Designer.Language/service.rs#L251)

<a id="function-replace"></a>

### replace

```rust
fn replace(self: &mut Self, uri: &str, source: impl Into<String>, version: i64) -> Result<()>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Designer.Language/service.rs#L285)

<a id="function-change"></a>

### change

```rust
fn change(self: &mut Self, uri: &str, version: i64, changes: &[TextChange]) -> Result<()>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Designer.Language/service.rs#L296)

<a id="function-index_solution"></a>

### index_solution

```rust
fn index_solution(self: &mut Self, solution: &ferroui_designer_project::Solution) -> Result<usize>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Designer.Language/service.rs#L311)

<a id="function-remove_solution"></a>

### remove_solution

```rust
fn remove_solution(self: &mut Self, root: impl AsRef<std::path::Path>) -> usize
```

Remove a workspace's disk snapshots while preserving open buffers and shared roots.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Designer.Language/service.rs#L357)

<a id="function-diagnostics"></a>

### diagnostics

```rust
fn diagnostics(self: &Self, uri: &str) -> Result<Vec<Diagnostic>>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Designer.Language/service.rs#L389)

<a id="function-completions"></a>

### completions

```rust
fn completions(self: &Self, uri: &str, offset: usize) -> Result<Vec<Completion>>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Designer.Language/service.rs#L588)

<a id="function-hover"></a>

### hover

```rust
fn hover(self: &Self, uri: &str, offset: usize) -> Result<Option<Hover>>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Designer.Language/service.rs#L1031)

<a id="function-signature_help"></a>

### signature_help

```rust
fn signature_help(self: &Self, uri: &str, offset: usize) -> Result<Option<SignatureHelp>>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Designer.Language/service.rs#L1080)

<a id="function-definitions"></a>

### definitions

```rust
fn definitions(self: &Self, uri: &str, offset: usize) -> Result<Vec<Location>>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Designer.Language/service.rs#L1118)

<a id="function-references"></a>

### references

```rust
fn references(self: &Self, uri: &str, offset: usize) -> Result<Vec<Location>>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Designer.Language/service.rs#L1173)

<a id="function-references_with_declarations"></a>

### references_with_declarations

```rust
fn references_with_declarations(self: &Self, uri: &str, offset: usize, include: bool) -> Result<Vec<Location>>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Designer.Language/service.rs#L1176)

<a id="function-rename"></a>

### rename

```rust
fn rename(self: &Self, uri: &str, offset: usize, new_name: &str) -> Result<WorkspaceEdit>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Designer.Language/service.rs#L1203)

<a id="function-apply_workspace_edit"></a>

### apply_workspace_edit

```rust
fn apply_workspace_edit(self: &mut Self, edit: &WorkspaceEdit) -> Result<()>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Designer.Language/service.rs#L1295)

<a id="function-format"></a>

### format

```rust
fn format(self: &Self, uri: &str, options: FormattingOptions) -> Result<Vec<TextEdit>>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Designer.Language/service.rs#L1316)

<a id="function-symbols"></a>

### symbols

```rust
fn symbols(self: &Self, uri: &str) -> Result<Vec<DocumentSymbol>>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Designer.Language/service.rs#L1319)

<a id="function-folding"></a>

### folding

```rust
fn folding(self: &Self, uri: &str) -> Result<Vec<FoldingRange>>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Designer.Language/service.rs#L1356)

<a id="function-semantic_tokens"></a>

### semantic_tokens

```rust
fn semantic_tokens(self: &Self, uri: &str) -> Result<Vec<SemanticToken>>
```

Token types: type, property, string, comment, variable, keyword, number, namespace.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Designer.Language/service.rs#L1388)

<a id="function-workspace_symbols"></a>

### workspace_symbols

```rust
fn workspace_symbols(self: &Self, query: &str) -> Result<Vec<(String, DocumentSymbol)>>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Designer.Language/service.rs#L1440)

<a id="function-resource_uri"></a>

### resource_uri

```rust
fn resource_uri(self: &Self, base: &str, reference: &str) -> Result<String>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Designer.Language/service.rs#L1454)

<a id="function-prepare_rename"></a>

### prepare_rename

```rust
fn prepare_rename(self: &Self, uri: &str, offset: usize) -> Result<Option<(Range, String)>>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Designer.Language/service.rs#L1473)

<a id="function-mark_saved"></a>

### mark_saved

```rust
fn mark_saved(self: &mut Self, uri: &str, text: Option<&str>) -> Result<()>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Designer.Language/service.rs#L1488)

<a id="function-rename_uri"></a>

### rename_uri

```rust
fn rename_uri(self: &mut Self, old: &str, new: &str) -> Result<()>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Designer.Language/service.rs#L1501)

<a id="function-rename_uris"></a>

### rename_uris

```rust
fn rename_uris(self: &mut Self, renames: &[(String, String)]) -> Result<()>
```

Validate an entire client rename notification before moving any indexed
state. A swap is legal; overwriting an unrelated document is not.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Designer.Language/service.rs#L1506)

<a id="function-file_rename_edits"></a>

### file_rename_edits

```rust
fn file_rename_edits(self: &Self, old: &str, new: &str) -> Result<WorkspaceEdit>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Designer.Language/service.rs#L1556)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- `Borrow<T>`
- `BorrowMut<T>`
- `CloneToUninit`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- `Any`
- `ToOwned`
- `Clone`
- `Default`

## Availability

Extracted for `aarch64-apple-darwin`. Cargo features are listed in the [crate index](/docs/0.5.0/api/).
