microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
163.63k stars 29.04k forks source link

Emmet cannot evaluate math expressions on the first line #46106

Closed alextegelid closed 6 years ago

alextegelid commented 6 years ago

Issue Type: Bug

Steps to reproduce

  1. Open a new editor
  2. Type a simple expression (in my case 160*4)
  3. Hit Cmd+Shift+Y (or select Evaluate math expression from the command palette)

Expected result The expression being exchanged for the correct answer (640 in my case).

Actual result An error notification saying Could not evaluate expression.

Note Adding a new line above the expression solves the issue.


VS Code version: Code 1.21.1 (79b44aa704ce542d8ca4a3cc44cfca566e7720f1, 2018-03-14T14:39:09.335Z) OS version: Darwin x64 16.7.0

System Info |Item|Value| |---|---| |CPUs|Intel(R) Core(TM) i5-5287U CPU @ 2.90GHz (4 x 2900)| |Load (avg)|3, 3, 2| |Memory (System)|8.00GB (0.06GB free)| |Process Argv|/Applications/Visual Studio Code.app/Contents/MacOS/Electron| |Screen Reader|no| |VM|0%|
Extensions (39) Extension|Author (truncated)|Version ---|---|--- clipboard-history|Anj|1.0.7 insertnumbers|Asu|0.9.1 vsc-material-theme|Equ|1.5.1 todo-tree|Gru|0.0.30 indenticator|Sir|0.5.0 vscode-wakatime|Wak|1.1.24 Bookmarks|ale|0.18.2 ACF-Snippet|ant|1.8.3 git-easy|bib|1.9.1 path-intellisense|chr|1.4.2 laravel-blade|cjh|1.1.2 woocommerce|cla|1.0.0 wpcs-whitelist-flags|cla|1.0.0 vscode-eslint|dba|1.4.7 vscode-dash|dee|1.8.0 githistory|don|0.4.0 jquerysnippets|don|0.0.1 gitlens|eam|8.1.1 php-debug|fel|1.12.2 php-intellisense|fel|2.2.9 php-pack|fel|1.0.1 auto-rename-tag|for|0.0.15 canvas-snippets|hol|0.3.2 rest-client|hum|0.17.0 vscode-random|jre|1.3.2 vs-color-picker|lih|0.7.0 ftp-sync|luk|0.3.3 dotenv|mik|1.0.1 vscode-apache|mrm|1.1.1 vscode-scss|mrm|0.6.2 cpptools|ms-|0.15.0 php-docblocker|nei|1.3.3 advanced-new-file|pat|1.1.0 sass-indented|rob|1.4.8 incremental-search|sie|0.2.1 vscode-fileutils|sle|2.8.1 wordpress-snippet|tun|1.1.2 vscode-arduino|vsc|0.2.11 better-align|wwm|1.1.6 (3 theme extensions excluded)

Reproduces without extensions

ramya-rao-a commented 6 years ago

Thanks for reporting @alextegelid PRs are welcome to fix this issue. The place to start looking is https://github.com/Microsoft/vscode/blob/1.21.1/extensions/emmet/src/evaluateMathExpression.ts

jeanp413 commented 6 years ago

Hi @ramya-rao-a , I'd like to take this up.

ramya-rao-a commented 6 years ago

Thanks @jeanp413!