-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SMIE mode not being applied properly #68
Comments
@rneatherway I also find the problem for the new version. So in the issue #59, I use my local old version to see whether SMIE will affect the save functionality. But I have some personal thing to do recently(until to the end of this month), so I will try to take a look of the problem when I have more time. Sorry for the inconvenience. I will try to see the problem ASAP. |
@rneatherway It seems that SMIE now already work quite properly on the most recent source, so is the problem solved already or is it still there? |
I don't think it is being applied actually. If I open a new F# file and type the following it is indented as: let x = 1
let y =
let z = (
1 + 2) where as if I move let x = 1
let y =
let z = (
1 + 2) In case it isn't clear you can do this with the following patch: diff --git a/fsharp-mode.el b/fsharp-mode.el
index 94f182c..5b82a47 100644
--- a/fsharp-mode.el
+++ b/fsharp-mode.el
@@ -193,7 +193,6 @@
(require 'company)
- (fsharp-mode-indent-smie-setup)
(use-local-map fsharp-mode-map)
@@ -273,6 +272,7 @@
(when file
(setq compile-command (fsharp-mode-choose-compile-command file))
(fsharp-mode--load-with-binding file)))
+ (fsharp-mode-indent-smie-setup)
(turn-on-fsharp-doc-mode)
(run-hooks 'fsharp-mode-hook)) |
Sorry for the late reply since I have some personal issue. I am also very new to (setq major-mode 'fsharp-mode
mode-name "fsharp"
local-abbrev-table fsharp-mode-abbrev-table
paragraph-start (concat "^$\\|" page-delimiter)
paragraph-separate paragraph-start
require-final-newline t
indent-tabs-mode nil
comment-start "//"
comment-end ""
comment-column 40
comment-start-skip "///* *"
comment-indent-function 'fsharp-comment-indent-function
indent-region-function 'fsharp-indent-region
indent-line-function 'fsharp-indent-line
underline-minimum-offset 4
paragraph-ignore-fill-prefix t
add-log-current-defun-function 'fsharp-current-defun
fsharp-last-noncomment-pos nil
fsharp-last-comment-start (make-marker)
fsharp-last-comment-end (make-marker)) It will work fine, any place after that will have some problem. So my assumption is that, Sorry for not being able offer much help. But I think we can still try to improve the F# indent without totally understanding the issue behind this, since what we need to do is to proper define the grammar for smie mode. If there is anything I can help, please let me know. I will have more time to contribute this project from now on. |
@m00nlight I found when trying to debug/enhance the SMIE configuration that the function
fsharp-smie-rules
was never being called. I managed to get it to be called by either invoking(fsharp-mode-indent-smie-setup)
manually or moving the call to the end of the definition offsharp-mode
. When it is working the indentation becomes different, probably worse. I don't know a lot about SMIE so would appreciate your input here.The text was updated successfully, but these errors were encountered: