Skip to content
Draft
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,8 @@ next-env.d.ts

# test subset config
packages/test-harness/testSubsetGrep.properties

data/playground/.metals
data/playground/.vscode
data/playground/.scala-build
.talon
19 changes: 19 additions & 0 deletions data/playground/elixir/calls.ex
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
defmodule Calls do
a()
b.()
c do
1
end
d.() do
end
e.() do
1
end
a x do
x
end
f.(0) do
1
end
Alias.g()
end
31 changes: 31 additions & 0 deletions data/playground/elixir/data-structures.ex
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
defmodule DataStructures do
[]
[a]
[A]
[1]
[1, 2]
[[1], 1]
%{}
%{a: 1, b: 2}
%{:a => 1, "b" => 2, c => 3}
%{"a" => 1, b: 2, c: 3}
%{user | name: "Jane", email: "[email protected]"}
%{user | "name" => "Jane"}
%AStruct{a: 1, b: 2}
%AnotherStruct{:a => 1, "b" => 2, c => 3}
%ThirdStruct{"a" => 1, b: 2, c: 3}
%User{user | name: "Jane", email: "[email protected]"}
%User{user | "name" => "Jane"}
%_{}
%name{}
%^name{}
%__MODULE__{}
%__MODULE__.Child{}
%:"Elixir.Mod"{}
%fun(){}
%Mod.fun(){}
%fun.(){}
{}
{1}
{1, 2}
end
62 changes: 62 additions & 0 deletions data/playground/elixir/functions.ex
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
defmodule Funcs do
def no_args() do
end

def no_args_no_parens do
end

def one_arg(x) do
x
end

def one_arg_no_parens(x) do
x
end

def two_args(x, y) do
x + y
end

def two_args_no_parens(x, y) do
x + y
end

def default_args_no_parens(x, y \\ 1) do
x + y
end

def default_args(x, y \\ 1) do
x + y
end

def do_block(), do: 1
def do_block(x), do: x

def pattern_matching([{x, y} | tail]) do
x + y
end

def one_guard(x) when x == 1 do
x
end

def multiple_guard(x) when x > 10 when x < 5 do
x
end

defp private(x) do
x
end

defmacro macro(x) do
quote do
[unquote(x)]
end
end

defguard guard(term) when is_integer(term) and rem(term, 2) == 0

def unquote(name)(unquote_splicing(args)) do
unquote(compiled)
end
end
2 changes: 1 addition & 1 deletion packages/common/src/extensionDependencies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export const extensionDependencies = [
"scalameta.metals",
"mrob95.vscode-talonscript",
"jrieken.vscode-tree-sitter-query",

// Necessary for the `drink cell` and `pour cell` tests
"ms-toolsai.jupyter",
"jakebecker.elixir-ls",
];
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
languageId: elixir
command:
version: 6
spokenForm: change funk
action:
name: clearAndSetSelection
target:
type: primitive
modifiers:
- type: containingScope
scopeType: {type: namedFunction}
usePrePhraseSnapshot: true
initialState:
documentContents: |
def fun() do
# body
end
selections:
- anchor: {line: 1, character: 2}
active: {line: 1, character: 2}
marks: {}
finalState:
documentContents: |+

selections:
- anchor: {line: 0, character: 0}
active: {line: 0, character: 0}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
languageId: elixir
command:
version: 6
spokenForm: change funk
action:
name: clearAndSetSelection
target:
type: primitive
modifiers:
- type: containingScope
scopeType: {type: namedFunction}
usePrePhraseSnapshot: true
initialState:
documentContents: |-
def fun(x) when x == 1 do
x
end
selections:
- anchor: {line: 1, character: 2}
active: {line: 1, character: 2}
marks: {}
finalState:
documentContents: ""
selections:
- anchor: {line: 0, character: 0}
active: {line: 0, character: 0}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
languageId: elixir
command:
version: 6
spokenForm: change funk
action:
name: clearAndSetSelection
target:
type: primitive
modifiers:
- type: containingScope
scopeType: {type: namedFunction}
usePrePhraseSnapshot: true
initialState:
documentContents: |-
defp fun(x) do
x
end
selections:
- anchor: {line: 1, character: 2}
active: {line: 1, character: 2}
marks: {}
finalState:
documentContents: ""
selections:
- anchor: {line: 0, character: 0}
active: {line: 0, character: 0}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
languageId: elixir
command:
version: 6
spokenForm: change funk
action:
name: clearAndSetSelection
target:
type: primitive
modifiers:
- type: containingScope
scopeType: {type: namedFunction}
usePrePhraseSnapshot: true
initialState:
documentContents: |-
defmacro fun(x) do
quote do
[unquote(x)]
end
end
selections:
- anchor: {line: 2, character: 4}
active: {line: 2, character: 4}
marks: {}
finalState:
documentContents: ""
selections:
- anchor: {line: 0, character: 0}
active: {line: 0, character: 0}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
languageId: elixir
command:
version: 6
spokenForm: change funk
action:
name: clearAndSetSelection
target:
type: primitive
modifiers:
- type: containingScope
scopeType: {type: namedFunction}
usePrePhraseSnapshot: true
initialState:
documentContents: |
defguard is_even(term) when is_integer(term) and rem(term, 2) == 0
selections:
- anchor: {line: 0, character: 26}
active: {line: 0, character: 26}
marks: {}
finalState:
documentContents: |+

selections:
- anchor: {line: 0, character: 0}
active: {line: 0, character: 0}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
languageId: elixir
command:
version: 6
spokenForm: change funk
action:
name: clearAndSetSelection
target:
type: primitive
modifiers:
- type: containingScope
scopeType: {type: namedFunction}
usePrePhraseSnapshot: true
initialState:
documentContents: |-
a x do
x
end
selections:
- anchor: {line: 1, character: 3}
active: {line: 1, character: 3}
marks: {}
thrownError: {name: NoContainingScopeError}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
languageId: elixir
command:
version: 6
spokenForm: change funk
action:
name: clearAndSetSelection
target:
type: primitive
modifiers:
- type: containingScope
scopeType: {type: namedFunction}
usePrePhraseSnapshot: true
initialState:
documentContents: |
def fun do
# body
end
selections:
- anchor: {line: 1, character: 2}
active: {line: 1, character: 2}
marks: {}
finalState:
documentContents: |+

selections:
- anchor: {line: 0, character: 0}
active: {line: 0, character: 0}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
languageId: elixir
command:
version: 6
spokenForm: change funk
action:
name: clearAndSetSelection
target:
type: primitive
modifiers:
- type: containingScope
scopeType: {type: namedFunction}
usePrePhraseSnapshot: true
initialState:
documentContents: |
def fun, do: 1
selections:
- anchor: {line: 0, character: 14}
active: {line: 0, character: 14}
marks: {}
finalState:
documentContents: |+

selections:
- anchor: {line: 0, character: 0}
active: {line: 0, character: 0}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
languageId: elixir
command:
version: 6
spokenForm: change funk
action:
name: clearAndSetSelection
target:
type: primitive
modifiers:
- type: containingScope
scopeType: {type: namedFunction}
usePrePhraseSnapshot: true
initialState:
documentContents: |
def fun(), do: 1
selections:
- anchor: {line: 0, character: 16}
active: {line: 0, character: 16}
marks: {}
finalState:
documentContents: |+

selections:
- anchor: {line: 0, character: 0}
active: {line: 0, character: 0}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
languageId: elixir
command:
version: 6
spokenForm: change funk
action:
name: clearAndSetSelection
target:
type: primitive
modifiers:
- type: containingScope
scopeType: {type: namedFunction}
usePrePhraseSnapshot: true
initialState:
documentContents: |-
def fun(x) do
x
end
selections:
- anchor: {line: 1, character: 2}
active: {line: 1, character: 2}
marks: {}
finalState:
documentContents: ""
selections:
- anchor: {line: 0, character: 0}
active: {line: 0, character: 0}
Loading