@@ -316,8 +316,12 @@ pub fn suggested_indent_for_pos(
316pub fn get_scopes(syntax: Option<&Syntax>, text: RopeSlice, pos: usize) -> Vec<&'static str> {
316pub fn get_scopes(syntax: Option<&Syntax>, text: RopeSlice, pos: usize) -> Vec<&'static str> {
317 let mut scopes = Vec::new();
317 let mut scopes = Vec::new();
318 if let Some(syntax) = syntax {
318 if let Some(syntax) = syntax {
319− let byte_start = text.char_to_byte(pos);
319+ let pos = text.char_to_byte(pos);
320− let node = match get_highest_syntax_node_at_bytepos(syntax, byte_start) {
320+ let mut node = match syntax
323+ .descendant_for_byte_range(pos, pos)
321 Some(node) => node,
325 Some(node) => node,
322 None => return scopes,
326 None => return scopes,
@@ -325,7 +329,8 @@ pub fn get_scopes(syntax: Option<&Syntax>, text: RopeSlice, pos: usize) -> Vec<&
325 scopes.push(node.kind());
329 scopes.push(node.kind());
327 while let Some(parent) = node.parent() {
331 while let Some(parent) = node.parent() {
328− scopes.push(parent.kind())
332+ scopes.push(parent.kind());