Coder Social home page Coder Social logo

my-code-actions's People

Contributors

rioj7 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

mattpenner

my-code-actions's Issues

PHP code action does not activate

Hello, I have designed a code action in php, but it does not appear, instead, I have this:
my code actions problem

I simplified the code action to see if it was a regex not matching, but that showed before keeps happening. This is the current code action:

"my-code-actions.actions": {
    "[php]": {
      "Add literal A to lang files": {
        "diagnostics": ["Undefined class constant.*"],
        "atCursor": "RPLC",
        "file": "/profe.com/lang/lang_es_ES.ini",
        "where": "start",
        "insertFind": "",
        "text": "{{diag:$1}} = {{atCursor:$1}}\n"
      }
    },
  }

What is the problem?

Create function does not work

After installing the extension and adding

"my-code-actions.actions": {
    "[html]": {
      "Create function {{atCursor:$1}}": {
        "file": "${fileBasenameNoExtension}.ts",
        "atCursor": "\\(click\\)=\"([^\"]+)\\(\\)\"",
        "text": "function {{atCursor:$1}}() {\n}\n\n"
      }
    }
  }

to the settings file it shows the option to create the function but when I click on it, it does nothing. Am I doing something wrong?

How might one insert a function at the end of a class?

I found your extension through your great answer here on SO.

Similar to the OP on that question I'm trying to add a new function to an Angular typescript class when clicking on the click handler in the corresponding html file. However, using your suggestion settings the function appears at the very top of the file, which breaks the code.

Ideally (for me) I would like it to appear at the end, but inside the class; i.e. the last function in the class. Assuming I had only one class in the file I'm thinking a "where":"beforeLast" option would work if I had "insertFind":"}".

Does this make sense or do you have a better suggestion for inserting the new function at the end of the class?

I.e.

import xxx;
import yyy;
@Component({
    selector: 'about',
    templateUrl: './about.component.html',
    styleUrls: ['./about.component.css']
})
export class AboutComponent {
    constructor() {
    }

    function() {
        somecode;
    }

    newlyInsertedFunction() {
    }
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.