microsoft / vscode

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

Emmet: Evaluate Math expressions does not accept mixed number formats/units #31681

Closed jens1o closed 6 years ago

jens1o commented 7 years ago
Extension Author (truncated) Version
Bookmarks ale 0.15.2
npm-intellisense chr 1.3.0
path-intellisense chr 1.4.2
regex chr 0.1.0
gitignore cod 0.5.0
vscode-dash dee 1.7.0
vscode-npm-source dku 1.0.0
python don 0.6.9
gitlens eam 4.3.2
tslint eg2 0.17.0
vscode-npm-script eg2 0.2.0
LogFileHighlighter emi 1.1.1
vscode-reveal evi 0.0.9
php-debug fel 1.11.1
php-intellisense fel 1.5.0
auto-close-tag for 0.4.3
auto-rename-tag for 0.0.14
gc-excelviewer Gra 1.1.15
composer ika 0.5.0
smarty imp 0.2.0
code-guid jam 1.0.1
StretchTimer jpa 0.0.1
json-to-ts Mar 1.5.2
Runner mat 0.1.14
vscode-apache mrm 1.1.1
cpptools ms- 0.12.1
github-issues-prs ms- 0.3.1
php-docblocker nei 1.2.0
emoji Per 0.0.3
vscode-versionlens pfl 0.19.1
datetime rid 1.0.5
vscode-icons rob 7.12.0
sharecode Rol 0.4.1
todotasks san 0.5.0
code-settings-sync Sha 2.8.2
vscode-spotify shy 2.0.0
packagelinker sin 0.0.3
code-spell-checker str 1.3.2
pdf tom 0.2.0
lorem-ipsum Tyr 1.0.0
vscode-arduino vsc 0.2.4
vscode-todo-highlight way 0.5.8
highlight-trailing-white-spaces yba 0.0.2

(2 theme extensions excluded)


Steps to Reproduce:

  1. Having this:
    
    <!DOCTYPE html>
    <html lang="en">
    <head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        body {
            background-attachment: fixed;
            background-color: #000f + 23;
        }
    </style>
    </head>
    <body>


2. Select the hex code and the number: 
![image](https://user-images.githubusercontent.com/11234139/28733897-7f250930-73de-11e7-8274-b9ca65071c62.png)
3. Let the emmet extension fail silently... "Emmet: Evaluate Math Expression".
4. See it does not replace it with `38` (`#000f + 23 = 15 + 23` = `38`) nor with `#26` or `#000026`.

<!-- Launch with `code --disable-extensions` to check. -->
Reproduces without extensions: Yes

This is something I like to use when I'm supposed to darkenize colors.
ramya-rao-a commented 6 years ago

@jens1o Correct me if I am wrong, but I dont see this being a feature in emmet either. Try it out in https://docs.emmet.io/actions/evaluate-math/.

For the Emmet: Evaluate Math Expression command we use the emmet module https://github.com/emmetio/math-expression.

Can you log this issue there?

jens1o commented 6 years ago

Alright, thank you. I didn't check whether this is a normal feature, but that was just what I expected it to do.