emacs-lsp / lsp-pyright

lsp-mode :heart: pyright
https://emacs-lsp.github.io/lsp-pyright
GNU General Public License v3.0
284 stars 24 forks source link

Disable tab error #56

Closed akayy-dev closed 3 years ago

akayy-dev commented 3 years ago

I edit my python code with tabs instead of spaces, I know that PEP 8 says to use spaces, but I honestly hate using them and I want my tab key to input... well tabs. Anyway I keep getting errors using pyright saying indentation contains tabs and I can't seem to get rid of them, has anyone else solved this issue?

seagle0128 commented 3 years ago

I am curious why don't you use (setq-default indent-tabs-mode nil)?

akayy-dev commented 3 years ago

I am curious why don't you use (setq-default indent-tabs-mode nil)?

What like this?

(add-hook 'python-mode-hook
  (lambda ()
    (setq indent-tabs-mode t)
    (setq python-indent 4)
    (setq tab-width 4)))

Sorry if i'm asking a dumb question i'm a bit new to Emacs and can't find a fix to this issue anywhere.

seagle0128 commented 3 years ago

I am curious why don't you use (setq-default indent-tabs-mode nil)?

What like this?

(add-hook 'python-mode-hook
  (lambda ()
    (setq indent-tabs-mode t)
    (setq python-indent 4)
    (setq tab-width 4)))

Sorry if i'm asking a dumb question i'm a bit new to Emacs and can't find a fix to this issue anywhere.

Should be (setq indent-tabs-mode nil).