Home
last modified time | relevance | path

Searched +full:text +full:- +full:edit (Results 1 – 25 of 741) sorted by relevance

12345678910>>...30

/third_party/rust/rust/src/tools/rust-analyzer/crates/syntax/test_data/parser/fuzz-failures/
D0000.rs6 pub fn parse(text: &str) -> File { in parse()
7 let tokens = tokenize(&text); in parse()
9 text, &tokens, grammar::root, in parse()
13 pub fn reparse(&self, edit: &AtomTextEdit) -> File { in reparse()
14 self.incremental_reparse(edit).unwrap_or_else(|| self.full_reparse(edit)) in reparse()
16 pub fn incremental_reparse(&self, edit: &AtomTextEdit) -> Option<File> { in incremental_reparse()
17 let (node, reparser) = find_reparsable_node(self.syntax(), edit.delete)?; in incremental_reparse()
18 let text = replace_range( in incremental_reparse() localVariable
19 node.text().to_string(), in incremental_reparse()
20 edit.delete - node.range().start(), in incremental_reparse()
[all …]
/third_party/rust/rust/src/tools/rust-analyzer/crates/syntax/src/parsing/
Dreparsing.rs1 //! Implementation of incremental re-parsing.
4 //! - if the edit modifies only a single token (like changing an identifier's
6 //! - otherwise, we search for the nearest `{}` block which contains the edit
22 edit: &Indel, in incremental_reparse()
24 ) -> Option<(GreenNode, Vec<SyntaxError>, TextRange)> { in incremental_reparse()
25 if let Some((green, new_errors, old_range)) = reparse_token(node, edit) { in incremental_reparse()
26 return Some((green, merge_errors(errors, new_errors, old_range, edit), old_range)); in incremental_reparse()
29 if let Some((green, new_errors, old_range)) = reparse_block(node, edit) { in incremental_reparse()
30 return Some((green, merge_errors(errors, new_errors, old_range, edit), old_range)); in incremental_reparse()
37 edit: &Indel, in reparse_token()
[all …]
/third_party/rust/rust/src/tools/rust-analyzer/crates/rust-analyzer/src/
Dlsp_utils.rs1 //! Utilities for LSP-related boilerplate code.
15 pub(crate) fn invalid_params_error(message: String) -> LspError { in invalid_params_error()
21 ) -> bool { in notification_is()
33 pub(crate) fn fraction(done: usize, total: usize) -> f64 { in fraction()
99 /// rust-analyzer is resilient -- if it fails, this doesn't usually affect
103 /// We do however want to pester rust-analyzer developers with panics and
171 file_contents: impl FnOnce() -> String, in apply_document_changes()
173 ) -> String { in apply_document_changes()
179 .map(|idx| content_changes.len() - idx - 1) in apply_document_changes()
182 let mut text: String = match content_changes.get_mut(start) { in apply_document_changes() localVariable
[all …]
/third_party/rust/rust/src/tools/rust-analyzer/crates/text-edit/src/
Dlib.rs3 //! `rust-analyzer` never mutates text itself and only sends diffs to clients,
5 //! rust-analyzer.
13 /// `InsertDelete` -- a single "atomic" change to text
19 /// Refers to offsets in the original text
35 pub fn insert(offset: TextSize, text: String) -> Indel { in insert()
36 Indel::replace(TextRange::empty(offset), text) in insert()
38 pub fn delete(range: TextRange) -> Indel { in delete()
41 pub fn replace(range: TextRange, replace_with: String) -> Indel { in replace()
45 pub fn apply(&self, text: &mut String) { in apply()
48 text.replace_range(start..end, &self.insert); in apply()
[all …]
/third_party/rust/rust/src/tools/rust-analyzer/crates/ide/src/
Djoin_lines.rs25 // https://user-images.githubusercontent.com/1711539/124515923-4504e800-dde9-11eb-8d58-d97945a1a785…
31 // | VS Code | **rust-analyzer: Join lines**
34 // image::https://user-images.githubusercontent.com/48062697/113020661-b6922200-917a-11eb-87c4-b75a…
39 ) -> TextEdit { in join_lines()
42 let text = syntax.text().slice(range.start()..); in join_lines() localVariable
43 let pos = match text.find_char('\n') { in join_lines()
52 let mut edit = TextEdit::builder(); in join_lines() localVariable
56 remove_newlines(config, &mut edit, &token, range) in join_lines()
59 NodeOrToken::Token(token) => remove_newlines(config, &mut edit, &token, range), in join_lines()
61 edit.finish() in join_lines()
[all …]
Dtyping.rs1 //! This module handles auto-magic editing actions applied together with users
4 //! ```text
8 //! | // <- cursor is here
24 ast::{self, edit::IndentLevel, AstToken},
38 edit: TextEdit, field
46 // - typing `let =` tries to smartly add `;` if `=` is followed by an existing expression
47 // - typing `=` between two expressions adds `;` when in statement position
48 // - typing `=` to turn an assignment into an equality comparison removes `;` when in expression po…
49 // - typing `.` in a chain method call auto-indents
50 // - typing `{` in front of an expression inserts a closing `}` after the expression
[all …]
/third_party/mesa3d/bin/pick/
Dui.py1 # Copyright © 2019-2020 Intel Corporation
57 def keypress(self, size: int, key: str) -> typing.Optional[str]:
69 class CommitWidget(urwid.Text):
71 # urwid.Text is normally not interactable, this is required to tell urwid
81 async def apply(self) -> None:
89 async def denominate(self) -> None:
94 async def backport(self) -> None:
99 def keypress(self, size: int, key: str) -> typing.Optional[str]:
111 class FocusAwareEdit(urwid.Edit):
113 """An Edit type that signals when it comes into and leaves focus."""
[all …]
/third_party/skia/m133/third_party/externals/icu/source/common/unicode/
Dedits.h18 * \brief C++ API: C++ class Edits for low-level string transformations on styled text.
26 …* Records lengths of string edits but not replacement text. Supports replacements, insertions, del…
27 * in linear progression. Does not support moving/reordering of text.
29 * There are two types of edits: <em>change edits</em> and <em>no-change edits</em>. Add edits to
31 …* {@link #addUnchanged(int32_t)} (for no-change edits). Change edits are retained with full granul…
32 …* whereas adjacent no-change edits are always merged together. In no-change edits, there is a one-
43 * next() on the iterator, skips over no-change edits (unchanged regions).
44 …* <li>{@link #getCoarseIterator()} treats adjacent change edits as a single edit. (Adjacent no-cha…
46 * <li>{@link #getCoarseChangesIterator()} treats adjacent change edits as a single edit, and when
47 * calling next() on the iterator, skips over no-change edits (unchanged regions).
[all …]
/third_party/icu/icu4c/source/common/unicode/
Dedits.h18 * \brief C++ API: C++ class Edits for low-level string transformations on styled text.
26 …* Records lengths of string edits but not replacement text. Supports replacements, insertions, del…
27 * in linear progression. Does not support moving/reordering of text.
29 * There are two types of edits: <em>change edits</em> and <em>no-change edits</em>. Add edits to
31 …* {@link #addUnchanged(int32_t)} (for no-change edits). Change edits are retained with full granul…
32 …* whereas adjacent no-change edits are always merged together. In no-change edits, there is a one-
43 * next() on the iterator, skips over no-change edits (unchanged regions).
44 …* <li>{@link #getCoarseIterator()} treats adjacent change edits as a single edit. (Adjacent no-cha…
46 * <li>{@link #getCoarseChangesIterator()} treats adjacent change edits as a single edit, and when
47 * calling next() on the iterator, skips over no-change edits (unchanged regions).
[all …]
/third_party/skia/third_party/externals/icu/source/common/unicode/
Dedits.h18 * \brief C++ API: C++ class Edits for low-level string transformations on styled text.
26 …* Records lengths of string edits but not replacement text. Supports replacements, insertions, del…
27 * in linear progression. Does not support moving/reordering of text.
29 * There are two types of edits: <em>change edits</em> and <em>no-change edits</em>. Add edits to
31 …* {@link #addUnchanged(int32_t)} (for no-change edits). Change edits are retained with full granul…
32 …* whereas adjacent no-change edits are always merged together. In no-change edits, there is a one-
43 * next() on the iterator, skips over no-change edits (unchanged regions).
44 …* <li>{@link #getCoarseIterator()} treats adjacent change edits as a single edit. (Adjacent no-cha…
46 * <li>{@link #getCoarseChangesIterator()} treats adjacent change edits as a single edit, and when
47 * calling next() on the iterator, skips over no-change edits (unchanged regions).
[all …]
/third_party/rust/rust/src/tools/rust-analyzer/crates/syntax/src/
Dfuzz.rs16 pub fn check_parser(text: &str) { in check_parser()
17 let file = SourceFile::parse(text); in check_parser()
23 text: String, field
24 edit: Indel, field
29 pub fn from_data(data: &[u8]) -> Option<Self> { in from_data()
38 let text = lines.collect::<Vec<_>>().join("\n"); in from_data() localVariable
39 let text = format!("{PREFIX}{text}{SUFFIX}"); in from_data() localVariable
40text.get(delete_start..delete_start.checked_add(delete_len)?)?; // make sure delete is a valid ran… in from_data()
44 format!("{}{}{}", &text[..delete_start], &insert, &text[delete_start + delete_len..]); in from_data()
45 let edit = Indel { insert, delete }; in from_data() localVariable
[all …]
/third_party/rust/rust/src/tools/rust-analyzer/crates/ide-db/src/
Dsource_change.rs28 ) -> Self { in from_edits()
32 pub fn from_text_edit(file_id: FileId, edit: TextEdit) -> Self { in from_text_edit()
34 source_file_edits: iter::once((file_id, edit)).collect(), in from_text_edit()
41 pub fn insert_source_edit(&mut self, file_id: FileId, edit: TextEdit) { in insert_source_edit()
44 never!(entry.get_mut().union(edit).is_err(), "overlapping edits for same file"); in insert_source_edit()
47 entry.insert(edit); in insert_source_edit()
52 pub fn push_file_system_edit(&mut self, edit: FileSystemEdit) { in push_file_system_edit()
53 self.file_system_edits.push(edit); in push_file_system_edit()
56 pub fn get_source_edit(&self, file_id: FileId) -> Option<&TextEdit> { in get_source_edit()
60 pub fn merge(mut self, other: SourceChange) -> SourceChange { in merge()
[all …]
/third_party/rust/rust/src/tools/rust-analyzer/crates/ide-assists/src/handlers/
Draw_string.rs16 // ->
22 pub(crate) fn make_raw_string(acc: &mut Assists, ctx: &AssistContext<'_>) -> Option<()> { in make_raw_string()
34 |edit| { in make_raw_string()
38 edit.insert(token.syntax().text_range().start(), format!("r{hashes}")); in make_raw_string()
39 edit.insert(token.syntax().text_range().end(), hashes); in make_raw_string()
41 edit.replace(token.syntax().text_range(), format!("r{hashes}\"{value}\"{hashes}")); in make_raw_string()
56 // ->
62 pub(crate) fn make_usual_string(acc: &mut Assists, ctx: &AssistContext<'_>) -> Option<()> { in make_usual_string()
73 |edit| { in make_usual_string()
77 if token.text()[offsets.contents - token.syntax().text_range().start()] == escaped { in make_usual_string()
[all …]
Dconvert_comment_block.rs3 ast::{self, edit::IndentLevel, Comment, CommentKind, CommentShape, Whitespace},
11 // Converts comments between block and single-line form.
14 // // Multi-line$0
17 // ->
20 // Multi-line
24 pub(crate) fn convert_comment_block(acc: &mut Assists, ctx: &AssistContext<'_>) -> Option<()> { in convert_comment_block()
28 if Whitespace::cast(prev).filter(|w| w.text().contains('\n')).is_none() { in convert_comment_block()
39 fn block_to_line(acc: &mut Assists, comment: ast::Comment) -> Option<()> { in block_to_line()
46 |edit| { in block_to_line()
50 let text = comment.text(); in block_to_line() localVariable
[all …]
Ddesugar_doc_comment.rs4 ast::{self, edit::IndentLevel, CommentPlacement, Whitespace},
16 // Desugars doc-comments to the attribute form.
19 // /// Multi-line$0
22 // ->
24 // #[doc = r"Multi-line
27 pub(crate) fn desugar_doc_comment(acc: &mut Assists, ctx: &AssistContext<'_>) -> Option<()> { in desugar_doc_comment()
34 if Whitespace::cast(prev).filter(|w| w.text().contains('\n')).is_none() { in desugar_doc_comment()
47 // Establish the target of our edit based on the comments we found in desugar_doc_comment()
60 "Desugar doc-comment to attribute macro", in desugar_doc_comment()
62 |edit| { in desugar_doc_comment()
[all …]
/third_party/rust/rust/src/tools/rust-analyzer/crates/ide/src/typing/
Don_enter.rs8 ast::{self, edit::IndentLevel, AstToken},
18 // rust-analyzer can override kbd:[Enter] key to make it smarter:
20 // - kbd:[Enter] inside triple-slash comments automatically inserts `///`
21 // - kbd:[Enter] in the middle or after a trailing space in `//` inserts `//`
22 // - kbd:[Enter] inside `//!` doc comments automatically inserts `//!`
23 // - kbd:[Enter] after `{` indents contents and closing `}` of single-line block
28 // Similarly, if rust-analyzer crashes or stops responding, `Enter` might not work.
29 // In that case, you can still press `Shift-Enter` to insert a newline.
35 // ----
38 // "command": "rust-analyzer.onEnter",
[all …]
/third_party/rust/crates/clap/clap_complete/tests/snapshots/
Dtwo_multi_valued_arguments.elvish5 set edit:completion:arg-completer[my-app] = {|@words|
9 fn cand {|text desc|
10 edit:complex-candidate $text &display=$text' '(spaces (- 14 (wcswidth $text)))$desc
12 var command = 'my-app'
13 for word $words[1..-1] {
14 if (str:has-prefix $word '-') {
20 &'my-app'= {
21 cand -h 'Print help'
22 cand --help 'Print help'
Dvalue_terminator.elvish5 set edit:completion:arg-completer[my-app] = {|@words|
9 fn cand {|text desc|
10 edit:complex-candidate $text &display=$text' '(spaces (- 14 (wcswidth $text)))$desc
12 var command = 'my-app'
13 for word $words[1..-1] {
14 if (str:has-prefix $word '-') {
20 &'my-app'= {
21 cand -h 'Print help'
22 cand --help 'Print help'
Daliases.elvish5 set edit:completion:arg-completer[my-app] = {|@words|
9 fn cand {|text desc|
10 edit:complex-candidate $text &display=$text' '(spaces (- 14 (wcswidth $text)))$desc
12 var command = 'my-app'
13 for word $words[1..-1] {
14 if (str:has-prefix $word '-') {
20 &'my-app'= {
21 cand -o 'cmd option'
22 cand -O 'cmd option'
23 cand --option 'cmd option'
[all …]
Dvalue_hint.elvish5 set edit:completion:arg-completer[my-app] = {|@words|
9 fn cand {|text desc|
10 edit:complex-candidate $text &display=$text' '(spaces (- 14 (wcswidth $text)))$desc
12 var command = 'my-app'
13 for word $words[1..-1] {
14 if (str:has-prefix $word '-') {
20 &'my-app'= {
21 cand --choice 'choice'
22 cand --unknown 'unknown'
23 cand --other 'other'
[all …]
Dbasic.elvish5 set edit:completion:arg-completer[my-app] = {|@words|
9 fn cand {|text desc|
10 edit:complex-candidate $text &display=$text' '(spaces (- 14 (wcswidth $text)))$desc
12 var command = 'my-app'
13 for word $words[1..-1] {
14 if (str:has-prefix $word '-') {
20 &'my-app'= {
21 cand -c 'c'
22 cand -v 'v'
23 cand -h 'Print help'
[all …]
/third_party/icu/ohos_icu4j/src/main/java/ohos/global/icu/text/
DEdits.java4 package ohos.global.icu.text;
10 …* Records lengths of string edits but not replacement text. Supports replacements, insertions, del…
11 * in linear progression. Does not support moving/reordering of text.
13 * There are two types of edits: <em>change edits</em> and <em>no-change edits</em>. Add edits to
15 …* {@link #addUnchanged(int)} (for no-change edits). Change edits are retained with full granularit…
16 …* whereas adjacent no-change edits are always merged together. In no-change edits, there is a one-
26 * next() on the iterator, skips over no-change edits (unchanged regions).
27 …* <li>{@link #getCoarseIterator()} treats adjacent change edits as a single edit. (Adjacent no-cha…
29 * <li>{@link #getCoarseChangesIterator()} treats adjacent change edits as a single edit, and when
30 * calling next() on the iterator, skips over no-change edits (unchanged regions).
[all …]
/third_party/icu/icu4j/main/classes/core/src/com/ibm/icu/text/
DEdits.java3 package com.ibm.icu.text;
9 …* Records lengths of string edits but not replacement text. Supports replacements, insertions, del…
10 * in linear progression. Does not support moving/reordering of text.
12 * There are two types of edits: <em>change edits</em> and <em>no-change edits</em>. Add edits to
14 …* {@link #addUnchanged(int)} (for no-change edits). Change edits are retained with full granularit…
15 …* whereas adjacent no-change edits are always merged together. In no-change edits, there is a one-
25 * next() on the iterator, skips over no-change edits (unchanged regions).
26 …* <li>{@link #getCoarseIterator()} treats adjacent change edits as a single edit. (Adjacent no-cha…
28 * <li>{@link #getCoarseChangesIterator()} treats adjacent change edits as a single edit, and when
29 * calling next() on the iterator, skips over no-change edits (unchanged regions).
[all …]
/third_party/rust/rust/src/tools/rust-analyzer/editors/code/src/
Dsnippets.ts5 export async function applySnippetWorkspaceEdit(edit: vscode.WorkspaceEdit) {
6 if (edit.entries().length === 1) {
7 const [uri, edits] = edit.entries()[0];
12 for (const [uri, edits] of edit.entries()) {
15 await editor.edit((builder) => {
19 `bad ws edit: snippet received with multiple edits: ${JSON.stringify(edit)}`
41 await editor.edit((builder) => {
51 lastNewline === -1
53 : prefix.length - lastNewline - 1;
66 countLines(indel.newText) - (indel.range.end.line - indel.range.start.line);
[all …]
/third_party/typescript/tests/baselines/reference/
Dparserindenter.types8 // http://www.apache.org/licenses/LICENSE-2.0
70 this.scriptBlockBeginLineNumber = -1;
71 >this.scriptBlockBeginLineNumber = -1 : -1
75 >-1 : -1
78 … this.offsetIndentationDeltas = new Dictionary_int_int(); // text offset -> indentation delta
232 var edit = result.get(i);
233 >edit : any
240 ….logger.log("edit: minChar=" + edit.position + ", limChar=" + (edit.position + edit.length) + ", t…
241 ….logger.log("edit: minChar=" + edit.position + ", limChar=" + (edit.position + edit.length) + ", t…
247 >"edit: minChar=" + edit.position + ", limChar=" + (edit.position + edit.length) + ", text=\"" + Ty…
[all …]

12345678910>>...30