Giter Site home page Giter Site logo

copy-with-imports's People

Contributors

cspotcode avatar jiejasonliu avatar jrmyio avatar lukeapage avatar stringham avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

copy-with-imports's Issues

Account for `baseUrl` when generating relative path from `tsconfig`

Steps to reproduce

Full reduced test case: https://github.com/OliverJAsh/copy-with-imports-base-url-test

Enable "copy-with-imports.path-relative-from-tsconfig": true.

tsconfig.json:

{
    "compilerOptions": {
        "baseUrl": "app"
    }
}

app/helpers/foo.ts:

export const foo = 1;

app/helpers/bar.ts:

import { foo } from "./foo";

// 1. copy this
console.log(foo)

app/helpers/baz.ts:

// 2. paste here

Actual

app/helpers/baz.ts:

import {foo} from 'app/helpers/foo';
// 2. paste here
console.log(foo)

Expected

app/helpers/baz.ts:

import {foo} from 'helpers/foo';
// 2. paste here
console.log(foo)
Screen.Recording.2021-12-06.at.10.57.02.mov

I think we need to account for config.compilerOptions.baseUrl here:

return path.relative(path.dirname(config.path), specifier);

Slows down copy

When copying code, it takes a while to be copied which is annoying, specially if you don't have a feedback that it's copied and then you keep switching files and paste an old paste.

disabling the extension, copying code is instant

Since installing the extension, it made copying and pasting more efforts and extra overload.

Please help. If slowing down is a must but at least provide a notification that the copy is ready.
Also, please limit the extension to work only in typescript, javascript, etc.. those that can come with imports but definitely not HTML.

Copying code messes up redo

let's say you do undo (cmd+z) a couple of times, then copy something(cmd+c), and then redo (cmd+shift+z) a couple of times. Without this extension you can do this. Unfortunately, with this extension enabled, after you copy(cmd+c), redo does not work. You lose your redo history.

Thanks! Love this extension!

Join imports from same package

Hi,

I really appreciate your work ๐Ÿ˜„ I'd like to know if it is possible to join imports from same package.

example:

showcase.mp4

in the example I'd like to have:

import React, {useContext} from 'react';

instead of:

import React from 'react';
import {useContext} from 'react';

Thank you!

When copying an exported default function in TSX files, it adds curly braces to the import

Awesome extension, I use it with my work, everyday but there is a small bug where I show below

When I copy lets say this function below in a .tsx file :

export default function Hello(){
    return <div>Hello World</div>
}

And then I paste it in another .tsx file, it adds curly braces to the import statement, like below :

import { Hello } from './components/hello';

export default function App(){
     return <Hello />
}

It shouldn't add curly braces when the function copied is an export default.
Is there a setting to fix this? or is this a known issue?
Any insight would be very helpful!

99% CPU consumption on Paste

Every time I copy & paste some code. The first time it worked. But never again. One of the 'Code Helper' consumes over 99% of CPU. I had to kill it manually to keep VSCode running. leading to VSCode Extension Host terminated unexpectedly.

Disable this extension solves the problem. But I really love the convenience this extension has been providing. Could you please take a look at this problem?

OS: Mac OSX 10.13.4 High Sierra
VSCode: 1.22.2

Support .js with allowJs?

Is it possible to support .js files with allowJs?

I imagine the changes would include:

  • file extension filters check tsconfig for allowJs. If true, match against .js and .jsx
  • check for a "jsconfig.json" if "tsconfig.json" is missing

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.