Skip to content

Commit c0bbb91

Browse files
authored
Check filetype for anon execution instead of file extension
The current implementation checks an anonymous buffer for the extension: 'apex'. Only in this case its possible to run the current file in an anonymous execution. It makes more sense to check if the filetype is 'apex' since its not necessary to save a file for anonymous execution
1 parent 88b10f2 commit c0bbb91

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lua/salesforce/execute_anon.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ local M = {}
1818
M.execute_anon = function()
1919
Debug:log("execute_anon.lua", "Executing anonymous Apex script...")
2020
local path = vim.fn.expand("%:p")
21-
local file_type = vim.fn.expand("%:e")
21+
local file_type = vim.bo.filetype
2222
local default_username = OrgManager:get_default_username()
2323

2424
if file_type ~= "apex" then

0 commit comments

Comments
 (0)